/* Generated by Cython 0.29.14 */

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

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

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
  #define PyObject_Unicode             PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

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


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

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

#define __PYX_HAVE__pyarrow__lib
#define __PYX_HAVE_API__pyarrow__lib
/* Early includes */
#include <stdint.h>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <memory>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stdio.h>
#include "pythread.h"
#include "arrow/python/platform.h"
#include <Python.h>
#include "numpy/halffloat.h"
#include "arrow/api.h"
#include "arrow/result.h"
#include "arrow/python/common.h"
#include "arrow/util/key_value_metadata.h"
#include "arrow/builder.h"
#include "arrow/io/api.h"
#include "arrow/ipc/api.h"
#include "arrow/csv/api.h"
#include "arrow/json/options.h"
#include "arrow/json/reader.h"
#include "arrow/compute/api.h"
#include "arrow/python/api.h"
#include "arrow/python/init.h"
#include "arrow/python/pyarrow.h"
#include "arrow/python/config.h"
#include "arrow/python/inference.h"
#include "arrow/extension_type.h"
#include "arrow/python/extension_type.h"
#include "arrow/python/benchmark.h"
#include "arrow/util/compression.h"
#include "arrow/util/thread_pool.h"
#include "arrow/array/concatenate.h"
#include <stdlib.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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


static const char *__pyx_f[] = {
  "pyarrow/error.pxi",
  "pyarrow/array.pxi",
  "pyarrow/io-hdfs.pxi",
  "pyarrow/pandas-shim.pxi",
  "pyarrow/types.pxi",
  "pyarrow/scalar.pxi",
  "pyarrow/io.pxi",
  "pyarrow/ipc.pxi",
  "pyarrow/lib.pyx",
  "stringsource",
  "pyarrow/memory.pxi",
  "pyarrow/builder.pxi",
  "pyarrow/table.pxi",
  "pyarrow/tensor.pxi",
  "pyarrow/feather.pxi",
  "pyarrow/serialization.pxi",
  "pyarrow/benchmark.pxi",
  "pyarrow/public-api.pxi",
  "pyarrow/lib.pxd",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};
/* 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()


/*--- Type declarations ---*/
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_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_FixedSizeBinaryType;
struct __pyx_obj_7pyarrow_3lib_Decimal128Type;
struct __pyx_obj_7pyarrow_3lib_BaseExtensionType;
struct __pyx_obj_7pyarrow_3lib_ExtensionType;
struct __pyx_obj_7pyarrow_3lib_PyExtensionType;
struct __pyx_obj_7pyarrow_3lib_Field;
struct __pyx_obj_7pyarrow_3lib_Schema;
struct __pyx_obj_7pyarrow_3lib_Scalar;
struct __pyx_obj_7pyarrow_3lib_NAType;
struct __pyx_obj_7pyarrow_3lib_ArrayValue;
struct __pyx_obj_7pyarrow_3lib_ScalarValue;
struct __pyx_obj_7pyarrow_3lib_Int8Value;
struct __pyx_obj_7pyarrow_3lib_Int64Value;
struct __pyx_obj_7pyarrow_3lib_ListValue;
struct __pyx_obj_7pyarrow_3lib_LargeListValue;
struct __pyx_obj_7pyarrow_3lib_StructValue;
struct __pyx_obj_7pyarrow_3lib_UnionValue;
struct __pyx_obj_7pyarrow_3lib_StringValue;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue;
struct __pyx_obj_7pyarrow_3lib__PandasConvertible;
struct __pyx_obj_7pyarrow_3lib_Array;
struct __pyx_obj_7pyarrow_3lib_Tensor;
struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR;
struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO;
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_Decimal128Array;
struct __pyx_obj_7pyarrow_3lib_StructArray;
struct __pyx_obj_7pyarrow_3lib_ListArray;
struct __pyx_obj_7pyarrow_3lib_LargeListArray;
struct __pyx_obj_7pyarrow_3lib_UnionArray;
struct __pyx_obj_7pyarrow_3lib_StringArray;
struct __pyx_obj_7pyarrow_3lib_BinaryArray;
struct __pyx_obj_7pyarrow_3lib_DictionaryArray;
struct __pyx_obj_7pyarrow_3lib_ExtensionArray;
struct __pyx_obj_7pyarrow_3lib_ChunkedArray;
struct __pyx_obj_7pyarrow_3lib_Table;
struct __pyx_obj_7pyarrow_3lib_RecordBatch;
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__CRecordBatchReader;
struct __pyx_obj_7pyarrow_3lib__PandasAPIShim;
struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool;
struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool;
struct __pyx_obj_7pyarrow_3lib_UnionType;
struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType;
struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny;
struct __pyx_obj_7pyarrow_3lib_NullType;
struct __pyx_obj_7pyarrow_3lib_BooleanValue;
struct __pyx_obj_7pyarrow_3lib_UInt8Value;
struct __pyx_obj_7pyarrow_3lib_Int16Value;
struct __pyx_obj_7pyarrow_3lib_UInt16Value;
struct __pyx_obj_7pyarrow_3lib_Int32Value;
struct __pyx_obj_7pyarrow_3lib_UInt32Value;
struct __pyx_obj_7pyarrow_3lib_UInt64Value;
struct __pyx_obj_7pyarrow_3lib_Date32Value;
struct __pyx_obj_7pyarrow_3lib_Date64Value;
struct __pyx_obj_7pyarrow_3lib_Time32Value;
struct __pyx_obj_7pyarrow_3lib_Time64Value;
struct __pyx_obj_7pyarrow_3lib_TimestampValue;
struct __pyx_obj_7pyarrow_3lib_HalfFloatValue;
struct __pyx_obj_7pyarrow_3lib_FloatValue;
struct __pyx_obj_7pyarrow_3lib_DoubleValue;
struct __pyx_obj_7pyarrow_3lib_DecimalValue;
struct __pyx_obj_7pyarrow_3lib_LargeStringValue;
struct __pyx_obj_7pyarrow_3lib_BinaryValue;
struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue;
struct __pyx_obj_7pyarrow_3lib_DictionaryValue;
struct __pyx_obj_7pyarrow_3lib_UInt8Scalar;
struct __pyx_obj_7pyarrow_3lib_Int8Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt16Scalar;
struct __pyx_obj_7pyarrow_3lib_Int16Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt32Scalar;
struct __pyx_obj_7pyarrow_3lib_Int32Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt64Scalar;
struct __pyx_obj_7pyarrow_3lib_Int64Scalar;
struct __pyx_obj_7pyarrow_3lib_FloatScalar;
struct __pyx_obj_7pyarrow_3lib_DoubleScalar;
struct __pyx_obj_7pyarrow_3lib__FunctionContext;
struct __pyx_obj_7pyarrow_3lib_Date32Array;
struct __pyx_obj_7pyarrow_3lib_Date64Array;
struct __pyx_obj_7pyarrow_3lib_TimestampArray;
struct __pyx_obj_7pyarrow_3lib_Time32Array;
struct __pyx_obj_7pyarrow_3lib_Time64Array;
struct __pyx_obj_7pyarrow_3lib_LargeStringArray;
struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray;
struct __pyx_obj_7pyarrow_3lib_StringBuilder;
struct __pyx_obj_7pyarrow_3lib_PythonFile;
struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile;
struct __pyx_obj_7pyarrow_3lib_OSFile;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter;
struct __pyx_obj_7pyarrow_3lib_BufferOutputStream;
struct __pyx_obj_7pyarrow_3lib_MockOutputStream;
struct __pyx_obj_7pyarrow_3lib_BufferReader;
struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem;
struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny;
struct __pyx_obj_7pyarrow_3lib_HdfsFile;
struct __pyx_obj_7pyarrow_3lib_MessageReader;
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter;
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader;
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter;
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader;
struct __pyx_obj_7pyarrow_3lib_FeatherWriter;
struct __pyx_obj_7pyarrow_3lib_FeatherReader;
struct __pyx_obj_7pyarrow_3lib_SerializationContext;
struct __pyx_obj_7pyarrow_3lib_SerializedPyObject;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr;
struct __pyx_opt_args_7pyarrow_3lib_ensure_type;
struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import;
struct __pyx_opt_args_7pyarrow_3lib_decimal128;
struct __pyx_opt_args_7pyarrow_3lib_dictionary;

/* "pyarrow/lib.pxd":494
 * 
 * # Default is allow_none=False
 * cdef DataType ensure_type(object type, c_bool allow_none=*)             # <<<<<<<<<<<<<<
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta)
 */
struct __pyx_opt_args_7pyarrow_3lib_ensure_type {
  int __pyx_n;
  bool allow_none;
};

/* "pyarrow/pandas-shim.pxi":90
 *             self.has_sparse = True
 * 
 *     cdef inline _check_import(self, bint raise_=True):             # <<<<<<<<<<<<<<
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 */
struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import {
  int __pyx_n;
  int raise_;
};

/* "pyarrow/types.pxi":91
 * # Workaround for Cython parsing bug
 * # https://github.com/cython/cython/issues/2143
 * ctypedef CFixedWidthType* _CFixedWidthTypePtr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef  arrow::FixedWidthType *__pyx_t_7pyarrow_3lib__CFixedWidthTypePtr;

/* "pyarrow/types.pxi":1647
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */
struct __pyx_opt_args_7pyarrow_3lib_decimal128 {
  int __pyx_n;
  int scale;
};

/* "pyarrow/types.pxi":1791
 * 
 * 
 * cpdef DictionaryType dictionary(index_type, value_type, bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */
struct __pyx_opt_args_7pyarrow_3lib_dictionary {
  int __pyx_n;
  int ordered;
};

/* "pyarrow/io.pxi":1241
 * 
 * 
 * ctypedef CBufferedInputStream* _CBufferedInputStreamPtr             # <<<<<<<<<<<<<<
 * ctypedef CBufferedOutputStream* _CBufferedOutputStreamPtr
 * ctypedef RandomAccessFile* _RandomAccessFilePtr
 */
typedef  arrow::io::BufferedInputStream *__pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr;

/* "pyarrow/io.pxi":1242
 * 
 * ctypedef CBufferedInputStream* _CBufferedInputStreamPtr
 * ctypedef CBufferedOutputStream* _CBufferedOutputStreamPtr             # <<<<<<<<<<<<<<
 * ctypedef RandomAccessFile* _RandomAccessFilePtr
 * 
 */
typedef  arrow::io::BufferedOutputStream *__pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr;

/* "pyarrow/io.pxi":1243
 * ctypedef CBufferedInputStream* _CBufferedInputStreamPtr
 * ctypedef CBufferedOutputStream* _CBufferedOutputStreamPtr
 * ctypedef RandomAccessFile* _RandomAccessFilePtr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef arrow::io::RandomAccessFile *__pyx_t_7pyarrow_3lib__RandomAccessFilePtr;

/* "pyarrow/public-api.pxi":70
 * # Workaround for Cython parsing bug
 * # https://github.com/cython/cython/issues/2143
 * ctypedef const CPyExtensionType* _CPyExtensionTypePtr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef  arrow::py::PyExtensionType const *__pyx_t_7pyarrow_3lib__CPyExtensionTypePtr;

/* "pyarrow/lib.pxd":36
 * cdef int check_status(const CStatus& status) nogil except -1
 * 
 * cdef class Message:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CMessage] message
 */
struct __pyx_obj_7pyarrow_3lib_Message {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::Message>  message;
};


/* "pyarrow/lib.pxd":41
 * 
 * 
 * cdef class MemoryPool:             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMemoryPool* pool
 */
struct __pyx_obj_7pyarrow_3lib_MemoryPool {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *__pyx_vtab;
   arrow::MemoryPool *pool;
};


/* "pyarrow/lib.pxd":51
 * 
 * 
 * cdef class DataType:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDataType] sp_type
 */
struct __pyx_obj_7pyarrow_3lib_DataType {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtab;
  std::shared_ptr< arrow::DataType>  sp_type;
   arrow::DataType *type;
  PyObject *pep3118_format;
  PyObject *__weakref__;
};


/* "pyarrow/lib.pxd":62
 * 
 * 
 * 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":67
 * 
 * 
 * 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":72
 * 
 * 
 * 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":80
 * 
 * 
 * cdef class DictionaryMemo:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Even though the CDictionaryMemo instance is private, we allocate
 */
struct __pyx_obj_7pyarrow_3lib_DictionaryMemo {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::DictionaryMemo>  sp_memo;
   arrow::ipc::DictionaryMemo *memo;
};


/* "pyarrow/lib.pxd":88
 * 
 * 
 * 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":93
 * 
 * 
 * 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":98
 * 
 * 
 * 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":103
 * 
 * 
 * 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":108
 * 
 * 
 * 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":113
 * 
 * 
 * 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":118
 * 
 * 
 * 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":123
 * 
 * 
 * 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":128
 * 
 * 
 * cdef class PyExtensionType(ExtensionType):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_PyExtensionType {
  struct __pyx_obj_7pyarrow_3lib_ExtensionType __pyx_base;
};


/* "pyarrow/lib.pxd":132
 * 
 * 
 * cdef class Field:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CField] sp_field
 */
struct __pyx_obj_7pyarrow_3lib_Field {
  PyObject_HEAD
  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":143
 * 
 * 
 * cdef class Schema:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSchema] sp_schema
 */
struct __pyx_obj_7pyarrow_3lib_Schema {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Schema *__pyx_vtab;
  std::shared_ptr< arrow::Schema>  sp_schema;
   arrow::Schema *schema;
};


/* "pyarrow/lib.pxd":152
 * 
 * 
 * cdef class Scalar:             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType type
 */
struct __pyx_obj_7pyarrow_3lib_Scalar {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":157
 * 
 * 
 * cdef class NAType(Scalar):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_NAType {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
};


/* "pyarrow/lib.pxd":161
 * 
 * 
 * cdef class ArrayValue(Scalar):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArray] sp_array
 */
struct __pyx_obj_7pyarrow_3lib_ArrayValue {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *__pyx_vtab;
  std::shared_ptr< arrow::Array>  sp_array;
  int64_t index;
};


/* "pyarrow/lib.pxd":171
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array)
 * 
 * cdef class ScalarValue(Scalar):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CScalar] sp_scalar
 */
struct __pyx_obj_7pyarrow_3lib_ScalarValue {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue *__pyx_vtab;
  std::shared_ptr< arrow::Scalar>  sp_scalar;
};


/* "pyarrow/lib.pxd":177
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar)
 * 
 * cdef class Int8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int8Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":181
 * 
 * 
 * cdef class Int64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":185
 * 
 * 
 * cdef class ListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType value_type
 */
struct __pyx_obj_7pyarrow_3lib_ListValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_DataType *value_type;
   arrow::ListArray *ap;
};


/* "pyarrow/lib.pxd":196
 * 
 * 
 * cdef class LargeListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType value_type
 */
struct __pyx_obj_7pyarrow_3lib_LargeListValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_DataType *value_type;
   arrow::LargeListArray *ap;
};


/* "pyarrow/lib.pxd":207
 * 
 * 
 * cdef class StructValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CStructArray* ap
 */
struct __pyx_obj_7pyarrow_3lib_StructValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
   arrow::StructArray *ap;
};


/* "pyarrow/lib.pxd":212
 * 
 * 
 * cdef class UnionValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CUnionArray* ap
 */
struct __pyx_obj_7pyarrow_3lib_UnionValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
   arrow::UnionArray *ap;
  PyObject *value_types;
};


/* "pyarrow/lib.pxd":220
 * 
 * 
 * cdef class StringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_StringValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":224
 * 
 * 
 * cdef class FixedSizeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":228
 * 
 * 
 * cdef class _PandasConvertible:             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib__PandasConvertible {
  PyObject_HEAD
};


/* "pyarrow/lib.pxd":232
 * 
 * 
 * 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;
  PyObject *__weakref__;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":248
 * 
 * 
 * cdef class Tensor:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTensor] sp_tensor
 */
struct __pyx_obj_7pyarrow_3lib_Tensor {
  PyObject_HEAD
  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;
};


/* "pyarrow/lib.pxd":259
 * 
 * 
 * cdef class SparseTensorCSR:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseTensorCSR] sp_sparse_tensor
 */
struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCSR *__pyx_vtab;
  std::shared_ptr< arrow::SparseTensorCSR>  sp_sparse_tensor;
   arrow::SparseTensorCSR *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":270
 * 
 * 
 * cdef class SparseTensorCOO:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseTensorCOO] sp_sparse_tensor
 */
struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCOO *__pyx_vtab;
  std::shared_ptr< arrow::SparseTensorCOO>  sp_sparse_tensor;
   arrow::SparseTensorCOO *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


/* "pyarrow/lib.pxd":357
 * 
 * 
 * cdef class ListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_ListArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":361
 * 
 * 
 * cdef class LargeListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_LargeListArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


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


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


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


/* "pyarrow/lib.pxd":377
 * 
 * 
 * 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":382
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_ExtensionArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":392
 * 
 * 
 * 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;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":405
 * 
 * 
 * cdef class Table(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTable] sp_table
 */
struct __pyx_obj_7pyarrow_3lib_Table {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Table *__pyx_vtab;
  std::shared_ptr< arrow::Table>  sp_table;
   arrow::Table *table;
};


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


/* "pyarrow/lib.pxd":422
 * 
 * 
 * cdef class Buffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CBuffer] buffer
 */
struct __pyx_obj_7pyarrow_3lib_Buffer {
  PyObject_HEAD
  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":432
 * 
 * 
 * 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":437
 * 
 * 
 * cdef class NativeFile:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[InputStream] input_stream
 */
struct __pyx_obj_7pyarrow_3lib_NativeFile {
  PyObject_HEAD
  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 own_file;
  PyObject *__weakref__;
};


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


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


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


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


/* "pyarrow/lib.pxd":477
 * 
 * 
 * cdef class _CRecordBatchWriter:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchWriter] writer
 */
struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::RecordBatchWriter>  writer;
};


/* "pyarrow/lib.pxd":482
 * 
 * 
 * cdef class _CRecordBatchReader:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchReader] reader
 */
struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader {
  PyObject_HEAD
  std::shared_ptr< arrow::RecordBatchReader>  reader;
};


/* "pyarrow/pandas-shim.pxi":20
 * # pandas lazy-loading API shim that reduces API call and import overhead
 * 
 * cdef class _PandasAPIShim(object):             # <<<<<<<<<<<<<<
 *     """
 *     Lazy pandas importer that isolates usages of pandas APIs and avoids
 */
struct __pyx_obj_7pyarrow_3lib__PandasAPIShim {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *__pyx_vtab;
  int _tried_importing_pandas;
  int _have_pandas;
  PyObject *_loose_version;
  PyObject *_version;
  PyObject *_pd;
  PyObject *_types_api;
  PyObject *_compat_module;
  PyObject *_data_frame;
  PyObject *_index;
  PyObject *_series;
  PyObject *_categorical_type;
  PyObject *_datetimetz_type;
  PyObject *_extension_array;
  PyObject *_array_like_types;
  int has_sparse;
};


/* "pyarrow/memory.pxi":65
 * 
 * 
 * cdef class LoggingMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 */
struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool __pyx_base;
  std::unique_ptr< arrow::LoggingMemoryPool>  logging_pool;
};


/* "pyarrow/memory.pxi":75
 * 
 * 
 * cdef class ProxyMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     """
 *     Memory pool implementation that tracks the number of bytes and
 */
struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool __pyx_base;
  std::unique_ptr< arrow::ProxyMemoryPool>  proxy_pool;
};


/* "pyarrow/types.pxi":342
 * 
 * 
 * cdef class UnionType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct data types.
 */
struct __pyx_obj_7pyarrow_3lib_UnionType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
};


/* "pyarrow/types.pxi":655
 * 
 * 
 * cdef class UnknownExtensionType(PyExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     A concrete class for Python-defined extension types that refer to
 */
struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType {
  struct __pyx_obj_7pyarrow_3lib_PyExtensionType __pyx_base;
  PyObject *serialized;
};


/* "pyarrow/types.pxi":2076
 * 
 * 
 * cdef class _ExtensionRegistryNanny:             # <<<<<<<<<<<<<<
 *     # Keep the registry alive until we have unregistered PyExtensionType
 *     cdef:
 */
struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny {
  PyObject_HEAD
  std::shared_ptr< arrow::ExtensionTypeRegistry>  registry;
};


/* "pyarrow/scalar.pxi":28
 * 
 * 
 * cdef class NullType(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     Singleton for null array elements.
 */
struct __pyx_obj_7pyarrow_3lib_NullType {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
};


/* "pyarrow/scalar.pxi":100
 * 
 * 
 * cdef class BooleanValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for boolean array elements.
 */
struct __pyx_obj_7pyarrow_3lib_BooleanValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":126
 * 
 * 
 * cdef class UInt8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt8Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":139
 * 
 * 
 * cdef class Int16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Int16Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":152
 * 
 * 
 * cdef class UInt16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt16Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":165
 * 
 * 
 * cdef class Int32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Int32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":178
 * 
 * 
 * cdef class UInt32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":204
 * 
 * 
 * cdef class UInt64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":217
 * 
 * 
 * cdef class Date32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Date32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":233
 * 
 * 
 * cdef class Date64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Date64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":248
 * 
 * 
 * cdef class Time32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Time32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":268
 * 
 * 
 * cdef class Time64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Time64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":373
 * 
 * 
 * cdef class TimestampValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for timestamp array elements.
 */
struct __pyx_obj_7pyarrow_3lib_TimestampValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":408
 * 
 * 
 * cdef class HalfFloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float16 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_HalfFloatValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":421
 * 
 * 
 * cdef class FloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_FloatValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":434
 * 
 * 
 * cdef class DoubleValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_DoubleValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":447
 * 
 * 
 * cdef class DecimalValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for decimal128 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_DecimalValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":487
 * 
 * 
 * cdef class LargeStringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large string (utf8) array elements.
 */
struct __pyx_obj_7pyarrow_3lib_LargeStringValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":512
 * 
 * 
 * cdef class BinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for variable-sized binary array elements.
 */
struct __pyx_obj_7pyarrow_3lib_BinaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":542
 * 
 * 
 * cdef class LargeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large variable-sized binary array elements.
 */
struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":765
 * 
 * 
 * cdef class DictionaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary-encoded array elements.
 */
struct __pyx_obj_7pyarrow_3lib_DictionaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":865
 *         return hash(self.as_py())
 * 
 * cdef class UInt8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt8Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":878
 * 
 * 
 * cdef class Int8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int8 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int8Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":891
 * 
 * 
 * cdef class UInt16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt16Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":904
 * 
 * 
 * cdef class Int16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int16Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":917
 * 
 * 
 * cdef class UInt32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt32Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":930
 * 
 * 
 * cdef class Int32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int32Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":943
 * 
 * 
 * cdef class UInt64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt64Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":956
 * 
 * 
 * cdef class Int64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int64 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int64Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":969
 * 
 * 
 * cdef class FloatScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float scalars.
 */
struct __pyx_obj_7pyarrow_3lib_FloatScalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":982
 * 
 * 
 * cdef class DoubleScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for double scalars.
 */
struct __pyx_obj_7pyarrow_3lib_DoubleScalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/array.pxi":308
 * 
 * 
 * cdef class _FunctionContext:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CFunctionContext] ctx
 */
struct __pyx_obj_7pyarrow_3lib__FunctionContext {
  PyObject_HEAD
  std::unique_ptr< arrow::compute::FunctionContext>  ctx;
};


/* "pyarrow/array.pxi":1090
 * 
 * 
 * cdef class Date32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date32 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Date32Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1096
 * 
 * 
 * cdef class Date64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date64 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Date64Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1102
 * 
 * 
 * cdef class TimestampArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of timestamp data type.
 */
struct __pyx_obj_7pyarrow_3lib_TimestampArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1108
 * 
 * 
 * cdef class Time32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time32 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Time32Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1114
 * 
 * 
 * cdef class Time64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time64 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Time64Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1368
 * 
 * 
 * cdef class LargeStringArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large string (or utf8) data type.
 */
struct __pyx_obj_7pyarrow_3lib_LargeStringArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/array.pxi":1406
 * 
 * 
 * cdef class LargeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large variable-sized binary data type.
 */
struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/builder.pxi":23
 * 
 * 
 * cdef class StringBuilder:             # <<<<<<<<<<<<<<
 *     """
 *     Builder class for UTF8 strings. This class exposes facilities for
 */
struct __pyx_obj_7pyarrow_3lib_StringBuilder {
  PyObject_HEAD
  std::unique_ptr< arrow::StringBuilder>  builder;
};


/* "pyarrow/io.pxi":617
 * 
 * 
 * cdef class PythonFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a Python file object.
 */
struct __pyx_obj_7pyarrow_3lib_PythonFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *handle;
};


/* "pyarrow/io.pxi":699
 * 
 * 
 * cdef class MemoryMappedFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream that represents a memory-mapped file.
 */
struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  std::shared_ptr< arrow::io::MemoryMappedFile>  handle;
  PyObject *path;
};


/* "pyarrow/io.pxi":810
 * 
 * 
 * cdef class OSFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a regular file descriptor.
 */
struct __pyx_obj_7pyarrow_3lib_OSFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *path;
};


/* "pyarrow/io.pxi":851
 * 
 * 
 * cdef class FixedSizeBufferWriter(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream writing to a Arrow buffer.
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":1129
 * 
 * 
 * cdef class BufferOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_7pyarrow_3lib_BufferOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  std::shared_ptr< arrow::ResizableBuffer>  buffer;
};


/* "pyarrow/io.pxi":1153
 * 
 * 
 * cdef class MockOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
struct __pyx_obj_7pyarrow_3lib_MockOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":1164
 * 
 * 
 * cdef class BufferReader(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Zero-copy reader from objects convertible to Arrow buffer
 */
struct __pyx_obj_7pyarrow_3lib_BufferReader {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_Buffer *buffer;
};


/* "pyarrow/io-hdfs.pxi":56
 * 
 * 
 * cdef class HadoopFileSystem:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CHadoopFileSystem] client
 */
struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *__pyx_vtab;
  std::shared_ptr< arrow::io::HadoopFileSystem>  client;
  int is_open;
  PyObject *host;
  PyObject *user;
  PyObject *kerb_ticket;
  PyObject *driver;
  int port;
  PyObject *extra_conf;
};


/* "pyarrow/io-hdfs.pxi":466
 * # decref'd which can cause the client to get closed first if the file has the
 * # last remaining reference
 * cdef class _HdfsFileNanny:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object client
 */
struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny {
  PyObject_HEAD
  PyObject *client;
  PyObject *file_handle_ref;
};


/* "pyarrow/io-hdfs.pxi":485
 * 
 * 
 * cdef class HdfsFile(NativeFile):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         int32_t buffer_size
 */
struct __pyx_obj_7pyarrow_3lib_HdfsFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  int32_t buffer_size;
  PyObject *mode;
  PyObject *parent;
};


/* "pyarrow/ipc.pxi":121
 * 
 * 
 * cdef class MessageReader:             # <<<<<<<<<<<<<<
 *     """
 *     Interface for reading Message objects from some source (like an
 */
struct __pyx_obj_7pyarrow_3lib_MessageReader {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::MessageReader>  reader;
};


/* "pyarrow/ipc.pxi":251
 * 
 * 
 * cdef class _RecordBatchStreamWriter(_CRecordBatchWriter):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[OutputStream] sink
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter __pyx_base;
  std::shared_ptr<arrow::io::OutputStream>  sink;
   arrow::ipc::IpcOptions options;
  int closed;
};


/* "pyarrow/ipc.pxi":333
 * 
 * 
 * cdef class _RecordBatchStreamReader(_CRecordBatchReader):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[InputStream] in_stream
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader __pyx_base;
  std::shared_ptr<arrow::io::InputStream>  in_stream;
  struct __pyx_obj_7pyarrow_3lib_Schema *schema;
};


/* "pyarrow/ipc.pxi":352
 * 
 * 
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter __pyx_base;
};


/* "pyarrow/ipc.pxi":367
 * 
 * 
 * cdef class _RecordBatchFileReader:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchFileReader] reader
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::RecordBatchFileReader>  reader;
  std::shared_ptr<arrow::io::RandomAccessFile>  file;
  struct __pyx_obj_7pyarrow_3lib_Schema *schema;
};


/* "pyarrow/feather.pxi":26
 * 
 * 
 * cdef class FeatherWriter:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CFeatherWriter] writer
 */
struct __pyx_obj_7pyarrow_3lib_FeatherWriter {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::feather::TableWriter>  writer;
  int64_t num_rows;
};


/* "pyarrow/feather.pxi":71
 * 
 * 
 * cdef class FeatherReader:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CFeatherReader] reader
 */
struct __pyx_obj_7pyarrow_3lib_FeatherReader {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::feather::TableReader>  reader;
};


/* "pyarrow/serialization.pxi":48
 * 
 * 
 * cdef class SerializationContext:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object type_to_type_id
 */
struct __pyx_obj_7pyarrow_3lib_SerializationContext {
  PyObject_HEAD
  PyObject *type_to_type_id;
  PyObject *whitelisted_types;
  PyObject *types_to_pickle;
  PyObject *custom_serializers;
  PyObject *custom_deserializers;
  PyObject *pickle_serializer;
  PyObject *pickle_deserializer;
};


/* "pyarrow/serialization.pxi":235
 * 
 * 
 * cdef class SerializedPyObject:             # <<<<<<<<<<<<<<
 *     """
 *     Arrow-serialized representation of Python object
 */
struct __pyx_obj_7pyarrow_3lib_SerializedPyObject {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject *__pyx_vtab;
   arrow::py::SerializedPyObject data;
  PyObject *base;
};


/* "pyarrow/types.pxi":320
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/types.pxi":377
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/types.pxi":858
 *         return self._field(key)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions {
  PyObject_HEAD
  PyObject *__pyx_v_pd;
};


/* "pyarrow/scalar.pxi":589
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/scalar.pxi":640
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/array.pxi":731
 *         return self.sp_array.get().null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/table.pxi":101
 *         return self.chunked_array.null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ {
  PyObject_HEAD
  PyObject *__pyx_v_chunk;
  PyObject *__pyx_v_item;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "pyarrow/table.pxi":325
 *         return list(self.iterchunks())
 * 
 *     def iterchunks(self):             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks {
  PyObject_HEAD
  PyObject *__pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pyarrow/table.pxi":1329
 *         return result
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns {
  PyObject_HEAD
  PyObject *__pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pyarrow/io.pxi":475
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download {
  PyObject_HEAD
  PyObject *__pyx_v_cleanup;
  int __pyx_v_done;
  PyObject *__pyx_v_stream;
  PyObject *__pyx_v_write_queue;
};


/* "pyarrow/io.pxi":563
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload {
  PyObject_HEAD
  int __pyx_v_done;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self;
  PyObject *__pyx_v_write_queue;
};


/* "pyarrow/ipc.pxi":149
 *         return result
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_message()
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self;
};


/* "pyarrow/ipc.pxi":298
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self;
};


/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple {
  PyObject_HEAD
  PyObject *__pyx_v_f;
};


/* "pyarrow/serialization.pxi":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *__pyx_outer_scope;
  PyObject *__pyx_v_n;
};



/* "pyarrow/memory.pxi":23
 * 
 * 
 * cdef class MemoryPool:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for memory allocation.
 */

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/types.pxi":94
 * 
 * 
 * cdef class DataType:             # <<<<<<<<<<<<<<
 *     """
 *     Base class of all Arrow data types.
 */

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 *(*child)(struct __pyx_obj_7pyarrow_3lib_DataType *, int);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtabptr_7pyarrow_3lib_DataType;


/* "pyarrow/types.pxi":242
 * 
 * 
 * cdef class ListType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for list data types.
 */

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/types.pxi":262
 * 
 * 
 * cdef class LargeListType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large list data types
 */

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/types.pxi":283
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StructType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_Field *(*field)(struct __pyx_obj_7pyarrow_3lib_StructType *, int);
  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/types.pxi":206
 * 
 * 
 * cdef class DictionaryType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary data types.
 */

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/types.pxi":394
 * 
 * 
 * cdef class TimestampType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for timestamp data types.
 */

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/types.pxi":435
 * 
 * 
 * cdef class Time32Type(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time32 data types.
 */

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/types.pxi":452
 * 
 * 
 * cdef class Time64Type(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time64 data types.
 */

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/types.pxi":469
 * 
 * 
 * cdef class FixedSizeBinaryType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for fixed-size binary data types.
 */

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/types.pxi":490
 * 
 * 
 * cdef class Decimal128Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for decimal128 data types.
 */

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/types.pxi":517
 * 
 * 
 * cdef class BaseExtensionType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete base class for extension types.
 */

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/types.pxi":541
 * 
 * 
 * cdef class ExtensionType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete base class for Python-defined extension types.
 */

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/types.pxi":616
 * 
 * 
 * cdef class PyExtensionType(ExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete base class for Python-defined extension types based on pickle
 */

struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType *__pyx_vtabptr_7pyarrow_3lib_PyExtensionType;


/* "pyarrow/types.pxi":719
 * 
 * 
 * cdef class Field:             # <<<<<<<<<<<<<<
 *     """
 *     A named field, with a data type, nullability, and optional metadata.
 */

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/types.pxi":842
 * 
 * 
 * cdef class Schema:             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

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/scalar.pxi":56
 * 
 * 
 * cdef class ArrayValue(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for non-null array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t);
  void (*_set_array)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;


/* "pyarrow/scalar.pxi":829
 * }
 * 
 * cdef class ScalarValue(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ScalarValue *, std::shared_ptr< arrow::Scalar>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;


/* "pyarrow/scalar.pxi":113
 * 
 * 
 * cdef class Int8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int8 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int8Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Value *__pyx_vtabptr_7pyarrow_3lib_Int8Value;


/* "pyarrow/scalar.pxi":191
 * 
 * 
 * cdef class Int64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Value *__pyx_vtabptr_7pyarrow_3lib_Int64Value;


/* "pyarrow/scalar.pxi":572
 * 
 * 
 * cdef class ListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for list array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ListValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_ListValue *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_ListValue *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *__pyx_vtabptr_7pyarrow_3lib_ListValue;


/* "pyarrow/scalar.pxi":623
 * 
 * 
 * cdef class LargeListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large list array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *__pyx_vtabptr_7pyarrow_3lib_LargeListValue;


/* "pyarrow/scalar.pxi":722
 * 
 * 
 * cdef class StructValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StructValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructValue *__pyx_vtabptr_7pyarrow_3lib_StructValue;


/* "pyarrow/scalar.pxi":674
 * 
 * 
 * cdef class UnionValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for union array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_UnionValue *, int64_t);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue *__pyx_vtabptr_7pyarrow_3lib_UnionValue;


/* "pyarrow/scalar.pxi":462
 * 
 * 
 * cdef class StringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for string (utf8) array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StringValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringValue *__pyx_vtabptr_7pyarrow_3lib_StringValue;


/* "pyarrow/scalar.pxi":701
 * 
 * 
 * cdef class FixedSizeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for fixed-size binary array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue;


/* "pyarrow/array.pxi":484
 * 
 * 
 * cdef class Array(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for all Arrow arrays.
 */

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 *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array *__pyx_vtabptr_7pyarrow_3lib_Array;


/* "pyarrow/tensor.pxi":19
 * 
 * 
 * cdef class Tensor:             # <<<<<<<<<<<<<<
 *     """
 *     A n-dimensional array a.k.a 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/tensor.pxi":246
 * 
 * 
 * cdef class SparseTensorCSR:             # <<<<<<<<<<<<<<
 *     """
 *     A sparse CSR tensor.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCSR {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *, std::shared_ptr< arrow::SparseTensorCSR>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCSR *__pyx_vtabptr_7pyarrow_3lib_SparseTensorCSR;


/* "pyarrow/tensor.pxi":129
 * 
 * 
 * cdef class SparseTensorCOO:             # <<<<<<<<<<<<<<
 *     """
 *     A sparse COO tensor.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCOO {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *, std::shared_ptr< arrow::SparseTensorCOO>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCOO *__pyx_vtabptr_7pyarrow_3lib_SparseTensorCOO;


/* "pyarrow/array.pxi":1012
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of null data type.
 */

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/array.pxi":1018
 * 
 * 
 * cdef class BooleanArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of boolean data type.
 */

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/array.pxi":1024
 * 
 * 
 * cdef class NumericArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for Arrow numeric arrays.
 */

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/array.pxi":1030
 * 
 * 
 * cdef class IntegerArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for Arrow integer arrays.
 */

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/array.pxi":1036
 * 
 * 
 * cdef class FloatingPointArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for Arrow floating-point arrays.
 */

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/array.pxi":1042
 * 
 * 
 * cdef class Int8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int8 data type.
 */

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/array.pxi":1048
 * 
 * 
 * cdef class UInt8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint8 data type.
 */

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/array.pxi":1054
 * 
 * 
 * cdef class Int16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int16 data type.
 */

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/array.pxi":1060
 * 
 * 
 * cdef class UInt16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint16 data type.
 */

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/array.pxi":1066
 * 
 * 
 * cdef class Int32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int32 data type.
 */

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/array.pxi":1072
 * 
 * 
 * cdef class UInt32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint32 data type.
 */

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/array.pxi":1078
 * 
 * 
 * cdef class Int64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int64 data type.
 */

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/array.pxi":1084
 * 
 * 
 * cdef class UInt64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint64 data type.
 */

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/array.pxi":1120
 * 
 * 
 * cdef class HalfFloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of float16 data type.
 */

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/array.pxi":1126
 * 
 * 
 * cdef class FloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of float32 data type.
 */

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/array.pxi":1132
 * 
 * 
 * cdef class DoubleArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of float64 data type.
 */

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/array.pxi":1138
 * 
 * 
 * cdef class FixedSizeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a fixed-size binary data type.
 */

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/array.pxi":1144
 * 
 * 
 * cdef class Decimal128Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of decimal128 data type.
 */

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/array.pxi":1513
 * 
 * 
 * cdef class StructArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a struct data type.
 */

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/array.pxi":1150
 * 
 * 
 * cdef class ListArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a list data type.
 */

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


/* "pyarrow/array.pxi":1202
 * 
 * 
 * cdef class LargeListArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a large list data type
 */

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


/* "pyarrow/array.pxi":1250
 * 
 * 
 * cdef class UnionArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a Union data type.
 */

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/array.pxi":1336
 * 
 * 
 * cdef class StringArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of string (or utf8) data type.
 */

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/array.pxi":1400
 * 
 * 
 * cdef class BinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of variable-sized binary data type.
 */

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/array.pxi":1412
 * 
 * 
 * cdef class DictionaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary-encoded Arrow arrays.
 */

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/array.pxi":1640
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow extension arrays.
 */

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/table.pxi":20
 * import warnings
 * 
 * cdef class ChunkedArray(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     Array backed via one or more memory chunks.
 */

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/table.pxi":788
 * 
 * 
 * cdef class Table(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     A collection of top-level named, equal length Arrow arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Table {
  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/table.pxi":457
 * 
 * 
 * cdef class RecordBatch(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     Batch of rows of columns of equal length
 */

struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch {
  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/io.pxi":880
 * 
 * 
 * cdef class Buffer:             # <<<<<<<<<<<<<<
 *     """
 *     The base class for all Arrow buffers.
 */

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/io.pxi":1061
 * 
 * 
 * cdef class ResizableBuffer(Buffer):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for buffers that can be resized.
 */

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/io.pxi":46
 * 
 * 
 * cdef class NativeFile:             # <<<<<<<<<<<<<<
 *     """
 *     The base class for all Arrow streams.
 */

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/io.pxi":1246
 * 
 * 
 * cdef class BufferedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 */

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/io.pxi":1296
 * 
 * 
 * cdef class BufferedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 */

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/io.pxi":1182
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     An input stream wrapper which decompresses data on the fly.
 */

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/io.pxi":1211
 * 
 * 
 * cdef class CompressedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     An output stream wrapper which compresses data on the fly.
 */

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/pandas-shim.pxi":20
 * # pandas lazy-loading API shim that reduces API call and import overhead
 * 
 * cdef class _PandasAPIShim(object):             # <<<<<<<<<<<<<<
 *     """
 *     Lazy pandas importer that isolates usages of pandas APIs and avoids
 */

struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim {
  PyObject *(*_import_pandas)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, int);
  PyObject *(*_check_import)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args);
  int (*_have_pandas_internal)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *);
  PyObject *(*infer_dtype)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_array_like)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_categorical)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_datetimetz)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_sparse)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_data_frame)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_series)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *__pyx_vtabptr_7pyarrow_3lib__PandasAPIShim;
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args);
static CYTHON_INLINE int __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *);


/* "pyarrow/memory.pxi":65
 * 
 * 
 * cdef class LoggingMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool {
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool *__pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool;


/* "pyarrow/memory.pxi":75
 * 
 * 
 * cdef class ProxyMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     """
 *     Memory pool implementation that tracks the number of bytes and
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool {
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool *__pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool;


/* "pyarrow/types.pxi":342
 * 
 * 
 * cdef class UnionType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UnionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionType *__pyx_vtabptr_7pyarrow_3lib_UnionType;


/* "pyarrow/types.pxi":655
 * 
 * 
 * cdef class UnknownExtensionType(PyExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     A concrete class for Python-defined extension types that refer to
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UnknownExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnknownExtensionType *__pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType;


/* "pyarrow/scalar.pxi":100
 * 
 * 
 * cdef class BooleanValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for boolean array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BooleanValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanValue *__pyx_vtabptr_7pyarrow_3lib_BooleanValue;


/* "pyarrow/scalar.pxi":126
 * 
 * 
 * cdef class UInt8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Value *__pyx_vtabptr_7pyarrow_3lib_UInt8Value;


/* "pyarrow/scalar.pxi":139
 * 
 * 
 * cdef class Int16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int16Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Value *__pyx_vtabptr_7pyarrow_3lib_Int16Value;


/* "pyarrow/scalar.pxi":152
 * 
 * 
 * cdef class UInt16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Value *__pyx_vtabptr_7pyarrow_3lib_UInt16Value;


/* "pyarrow/scalar.pxi":165
 * 
 * 
 * cdef class Int32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Value *__pyx_vtabptr_7pyarrow_3lib_Int32Value;


/* "pyarrow/scalar.pxi":178
 * 
 * 
 * cdef class UInt32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Value *__pyx_vtabptr_7pyarrow_3lib_UInt32Value;


/* "pyarrow/scalar.pxi":204
 * 
 * 
 * cdef class UInt64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Value *__pyx_vtabptr_7pyarrow_3lib_UInt64Value;


/* "pyarrow/scalar.pxi":217
 * 
 * 
 * cdef class Date32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Value *__pyx_vtabptr_7pyarrow_3lib_Date32Value;


/* "pyarrow/scalar.pxi":233
 * 
 * 
 * cdef class Date64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Value *__pyx_vtabptr_7pyarrow_3lib_Date64Value;


/* "pyarrow/scalar.pxi":248
 * 
 * 
 * cdef class Time32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Value *__pyx_vtabptr_7pyarrow_3lib_Time32Value;


/* "pyarrow/scalar.pxi":268
 * 
 * 
 * cdef class Time64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Value *__pyx_vtabptr_7pyarrow_3lib_Time64Value;


/* "pyarrow/scalar.pxi":373
 * 
 * 
 * cdef class TimestampValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for timestamp array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_TimestampValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampValue *__pyx_vtabptr_7pyarrow_3lib_TimestampValue;


/* "pyarrow/scalar.pxi":408
 * 
 * 
 * cdef class HalfFloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float16 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatValue *__pyx_vtabptr_7pyarrow_3lib_HalfFloatValue;


/* "pyarrow/scalar.pxi":421
 * 
 * 
 * cdef class FloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FloatValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatValue *__pyx_vtabptr_7pyarrow_3lib_FloatValue;


/* "pyarrow/scalar.pxi":434
 * 
 * 
 * cdef class DoubleValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DoubleValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleValue *__pyx_vtabptr_7pyarrow_3lib_DoubleValue;


/* "pyarrow/scalar.pxi":447
 * 
 * 
 * cdef class DecimalValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for decimal128 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DecimalValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DecimalValue *__pyx_vtabptr_7pyarrow_3lib_DecimalValue;


/* "pyarrow/scalar.pxi":487
 * 
 * 
 * cdef class LargeStringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large string (utf8) array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringValue *__pyx_vtabptr_7pyarrow_3lib_LargeStringValue;


/* "pyarrow/scalar.pxi":512
 * 
 * 
 * cdef class BinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for variable-sized binary array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BinaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryValue *__pyx_vtabptr_7pyarrow_3lib_BinaryValue;


/* "pyarrow/scalar.pxi":542
 * 
 * 
 * cdef class LargeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large variable-sized binary array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryValue *__pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue;


/* "pyarrow/scalar.pxi":765
 * 
 * 
 * cdef class DictionaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary-encoded array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryValue *__pyx_vtabptr_7pyarrow_3lib_DictionaryValue;


/* "pyarrow/scalar.pxi":865
 *         return hash(self.as_py())
 * 
 * cdef class UInt8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt8Scalar;


/* "pyarrow/scalar.pxi":878
 * 
 * 
 * cdef class Int8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int8 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int8Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Scalar *__pyx_vtabptr_7pyarrow_3lib_Int8Scalar;


/* "pyarrow/scalar.pxi":891
 * 
 * 
 * cdef class UInt16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt16Scalar;


/* "pyarrow/scalar.pxi":904
 * 
 * 
 * cdef class Int16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int16Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Scalar *__pyx_vtabptr_7pyarrow_3lib_Int16Scalar;


/* "pyarrow/scalar.pxi":917
 * 
 * 
 * cdef class UInt32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt32Scalar;


/* "pyarrow/scalar.pxi":930
 * 
 * 
 * cdef class Int32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int32Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Scalar *__pyx_vtabptr_7pyarrow_3lib_Int32Scalar;


/* "pyarrow/scalar.pxi":943
 * 
 * 
 * cdef class UInt64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt64Scalar;


/* "pyarrow/scalar.pxi":956
 * 
 * 
 * cdef class Int64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int64 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int64Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Scalar *__pyx_vtabptr_7pyarrow_3lib_Int64Scalar;


/* "pyarrow/scalar.pxi":969
 * 
 * 
 * cdef class FloatScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FloatScalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatScalar *__pyx_vtabptr_7pyarrow_3lib_FloatScalar;


/* "pyarrow/scalar.pxi":982
 * 
 * 
 * cdef class DoubleScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for double scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DoubleScalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleScalar *__pyx_vtabptr_7pyarrow_3lib_DoubleScalar;


/* "pyarrow/array.pxi":1090
 * 
 * 
 * cdef class Date32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date32 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Array *__pyx_vtabptr_7pyarrow_3lib_Date32Array;


/* "pyarrow/array.pxi":1096
 * 
 * 
 * cdef class Date64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date64 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Array *__pyx_vtabptr_7pyarrow_3lib_Date64Array;


/* "pyarrow/array.pxi":1102
 * 
 * 
 * cdef class TimestampArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of timestamp data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_TimestampArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampArray *__pyx_vtabptr_7pyarrow_3lib_TimestampArray;


/* "pyarrow/array.pxi":1108
 * 
 * 
 * cdef class Time32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time32 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Array *__pyx_vtabptr_7pyarrow_3lib_Time32Array;


/* "pyarrow/array.pxi":1114
 * 
 * 
 * cdef class Time64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time64 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Array *__pyx_vtabptr_7pyarrow_3lib_Time64Array;


/* "pyarrow/array.pxi":1368
 * 
 * 
 * cdef class LargeStringArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large string (or utf8) data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringArray *__pyx_vtabptr_7pyarrow_3lib_LargeStringArray;


/* "pyarrow/array.pxi":1406
 * 
 * 
 * cdef class LargeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large variable-sized binary data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryArray *__pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray;


/* "pyarrow/io.pxi":617
 * 
 * 
 * cdef class PythonFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a Python file object.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *__pyx_vtabptr_7pyarrow_3lib_PythonFile;


/* "pyarrow/io.pxi":699
 * 
 * 
 * cdef class MemoryMappedFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream that represents a memory-mapped file.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *__pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile;


/* "pyarrow/io.pxi":810
 * 
 * 
 * cdef class OSFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a regular file descriptor.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_OSFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *(*_open_readable)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string,  arrow::MemoryPool *);
  PyObject *(*_open_writable)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *__pyx_vtabptr_7pyarrow_3lib_OSFile;


/* "pyarrow/io.pxi":851
 * 
 * 
 * cdef class FixedSizeBufferWriter(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream writing to a Arrow buffer.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBufferWriter {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter;


/* "pyarrow/io.pxi":1129
 * 
 * 
 * cdef class BufferOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream *__pyx_vtabptr_7pyarrow_3lib_BufferOutputStream;


/* "pyarrow/io.pxi":1153
 * 
 * 
 * cdef class MockOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MockOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MockOutputStream *__pyx_vtabptr_7pyarrow_3lib_MockOutputStream;


/* "pyarrow/io.pxi":1164
 * 
 * 
 * cdef class BufferReader(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Zero-copy reader from objects convertible to Arrow buffer
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader *__pyx_vtabptr_7pyarrow_3lib_BufferReader;


/* "pyarrow/io-hdfs.pxi":56
 * 
 * 
 * cdef class HadoopFileSystem:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CHadoopFileSystem] client
 */

struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem {
  PyObject *(*_ensure_client)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *);
  PyObject *(*_path_info)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *, PyObject *, arrow::io::HdfsPathInfo *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *__pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem;


/* "pyarrow/io-hdfs.pxi":485
 * 
 * 
 * cdef class HdfsFile(NativeFile):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         int32_t buffer_size
 */

struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *__pyx_vtabptr_7pyarrow_3lib_HdfsFile;


/* "pyarrow/serialization.pxi":235
 * 
 * 
 * cdef class SerializedPyObject:             # <<<<<<<<<<<<<<
 *     """
 *     Arrow-serialized representation of Python object
 */

struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject {
  PyObject *(*_write_to)(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *, arrow::io::OutputStream *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject *__pyx_vtabptr_7pyarrow_3lib_SerializedPyObject;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

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

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

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

/* 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);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

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

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

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

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

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

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

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

/* py_abs.proto */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
#define __Pyx_PyNumber_Absolute(x)\
    ((likely(PyLong_CheckExact(x))) ?\
         (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
         PyNumber_Absolute(x))
#else
#define __Pyx_PyNumber_Absolute(x)  PyNumber_Absolute(x)
#endif

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

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

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

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

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

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

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

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

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

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod1.proto */
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

/* IncludeCppStringH.proto */
#include <string>

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

/* decode_c_bytes.proto */
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(), cppstring.size(), start, stop, encoding, errors, decode_func);
}

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

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

/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
         PyObject* string, 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(
        PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
        start, stop, encoding, errors, decode_func);
}

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

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

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

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

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

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

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

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

/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif

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

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

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(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)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

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

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

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

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* 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 >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

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

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

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(enum  arrow::Type::type value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type(enum  arrow::UnionMode::type value);

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(enum  arrow::TimeUnit::type value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value);

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

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

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE enum  arrow::Type::type __Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(PyObject *);

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

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

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

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

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

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

static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, int __pyx_v_raise_); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args); /* proto*/
static CYTHON_INLINE int __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_7pyarrow_3lib_10MemoryPool_init(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self,  arrow::MemoryPool *__pyx_v_pool); /* proto*/
static void __pyx_f_7pyarrow_3lib_8DataType_init(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_8DataType_child(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, int __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_14DictionaryType_init(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_8ListType_init(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_13LargeListType_init(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10StructType_init(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, int __pyx_v_i); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field_by_name(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_name); /* proto*/
static void __pyx_f_7pyarrow_3lib_9UnionType_init(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_13TimestampType_init(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10Time32Type_init(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10Time64Type_init(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_14Decimal128Type_init(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_17BaseExtensionType_init(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_13ExtensionType_init(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_5Field_init(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, std::shared_ptr< arrow::Field>  const &__pyx_v_field); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Schema_init(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::vector<std::shared_ptr< arrow::Field> >  const &__pyx_v_fields); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Schema_init_schema(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::shared_ptr< arrow::Schema>  const &__pyx_v_schema); /* proto*/
static void __pyx_f_7pyarrow_3lib_10ArrayValue_init(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array, int64_t __pyx_v_index); /* proto*/
static void __pyx_f_7pyarrow_3lib_10ArrayValue__set_array(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static void __pyx_f_7pyarrow_3lib_9ListValue__set_array(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_9ListValue_getitem(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_9ListValue_length(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_3lib_14LargeListValue__set_array(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14LargeListValue_getitem(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_14LargeListValue_length(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_3lib_10UnionValue__set_array(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10UnionValue_getitem(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_11StructValue__set_array(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static void __pyx_f_7pyarrow_3lib_11ScalarValue_init(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar); /* proto*/
static void __pyx_f_7pyarrow_3lib_5Array_init(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_5Array_length(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_5Array_getitem(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_12ChunkedArray_init(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, std::shared_ptr< arrow::ChunkedArray>  const &__pyx_v_chunked_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_12ChunkedArray_getitem(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_11RecordBatch_init(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, std::shared_ptr< arrow::RecordBatch>  const &__pyx_v_batch); /* proto*/
static void __pyx_f_7pyarrow_3lib_5Table_init(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, std::shared_ptr< arrow::Table>  const &__pyx_v_table); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Tensor_init(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, std::shared_ptr< arrow::Tensor>  const &__pyx_v_sp_tensor); /* proto*/
static void __pyx_f_7pyarrow_3lib_15SparseTensorCOO_init(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, std::shared_ptr< arrow::SparseTensorCOO>  const &__pyx_v_sp_sparse_tensor); /* proto*/
static void __pyx_f_7pyarrow_3lib_15SparseTensorCSR_init(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, std::shared_ptr< arrow::SparseTensorCSR>  const &__pyx_v_sp_sparse_tensor); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle); /* proto*/
static std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static std::shared_ptr<arrow::io::InputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static std::shared_ptr<arrow::io::OutputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_readable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path,  arrow::MemoryPool *__pyx_v_pool); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_writable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Buffer_init(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, std::shared_ptr< arrow::Buffer>  const &__pyx_v_buffer); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6Buffer_getitem(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_15ResizableBuffer_init_rz(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, std::shared_ptr< arrow::ResizableBuffer>  const &__pyx_v_buffer); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, arrow::io::HdfsPathInfo *__pyx_v_info); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, arrow::io::OutputStream *__pyx_v_stream); /* proto*/

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

/* Module declarations from 'libcpp' */

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

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

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

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

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

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

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from 'cpython' */

/* Module declarations from 'pyarrow.includes.common' */
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_8includes_6common_PyObject_to_object(PyObject *); /*proto*/

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

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

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

/* Module declarations from 'pyarrow.lib' */
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Message = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DataType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryMemo = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Type = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Type = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Type = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BaseExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_PyExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Field = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Schema = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NAType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ArrayValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ScalarValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasConvertible = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Tensor = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseTensorCSR = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseTensorCOO = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NullArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BooleanArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NumericArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_IntegerArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatingPointArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HalfFloatArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ChunkedArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Table = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_RecordBatch = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Buffer = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ResizableBuffer = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NativeFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedInputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedInputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__CRecordBatchReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasAPIShim = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LoggingMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnknownExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__ExtensionRegistryNanny = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NullType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BooleanValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HalfFloatValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DecimalValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeStringValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeBinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatScalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleScalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__FunctionContext = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeStringArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeBinaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringBuilder = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_PythonFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryMappedFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_OSFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MockOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HadoopFileSystem = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__HdfsFileNanny = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HdfsFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MessageReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchStreamReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchFileWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FeatherWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FeatherReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SerializationContext = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SerializedPyObject = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_iterchunks = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_itercolumns = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10_download = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11_upload = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_15_genexpr = 0;
static struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_7pyarrow_3lib_pandas_api = 0;
static struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_7pyarrow_3lib__default_memory_pool = 0;
static struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_7pyarrow_3lib__logging_memory_pool = 0;
static PyObject *__pyx_v_7pyarrow_3lib__pandas_type_map = 0;
static PyObject *__pyx_v_7pyarrow_3lib__pep3118_type_map = 0;
static PyObject *__pyx_v_7pyarrow_3lib__type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES = 0;
static PyObject *__pyx_v_7pyarrow_3lib__timestamp_type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib__time_type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib__type_aliases = 0;
static PyObject *__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS = 0;
static bool __pyx_v_7pyarrow_3lib__datetime_conversion_initialized;
static PyObject *__pyx_v_7pyarrow_3lib__array_value_classes = 0;
static PyObject *__pyx_v_7pyarrow_3lib__scalar_classes = 0;
static struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_7pyarrow_3lib__global_ctx = 0;
static PyObject *__pyx_v_7pyarrow_3lib__array_classes = 0;
static int __pyx_f_7pyarrow_3lib_check_status(arrow::Status const &); /*proto*/
static  arrow::MemoryPool *__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(struct __pyx_obj_7pyarrow_3lib_MemoryPool *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_wrap_array_output(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_box_scalar(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_input_stream(PyObject *, bool, std::shared_ptr<arrow::io::InputStream>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_reader(PyObject *, bool, std::shared_ptr<arrow::io::RandomAccessFile>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_writer(PyObject *, std::shared_ptr<arrow::io::OutputStream>  *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_ensure_type(PyObject *, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args); /*proto*/
static std::shared_ptr< arrow::KeyValueMetadata>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(std::shared_ptr< arrow::KeyValueMetadata const >  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_array(std::shared_ptr< arrow::Array>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(std::shared_ptr< arrow::ChunkedArray>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(std::shared_ptr< arrow::RecordBatch>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(std::shared_ptr< arrow::Buffer>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(std::shared_ptr< arrow::DataType>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_field(std::shared_ptr< arrow::Field>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer(std::shared_ptr< arrow::ResizableBuffer>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(std::shared_ptr< arrow::Schema>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_table(std::shared_ptr< arrow::Table>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(std::shared_ptr< arrow::Tensor>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_coo(std::shared_ptr< arrow::SparseTensorCOO>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_csr(std::shared_ptr< arrow::SparseTensorCSR>  const &); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Array>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::RecordBatch>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Field>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_field(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Schema>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Table>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_table(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Tensor>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::SparseTensorCOO>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_tensor_coo(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::SparseTensorCSR>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_tensor_csr(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_internal_check_status(arrow::Status const &); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__datatype_to_pep3118( arrow::DataType *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_primitive_type(enum  arrow::Type::type); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_timeunit_to_string(enum  arrow::TimeUnit::type); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_decimal128(int, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_decimal128 *__pyx_optional_args); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_f_7pyarrow_3lib_list_(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_f_7pyarrow_3lib_large_list(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_f_7pyarrow_3lib_dictionary(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_dictionary *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_milli(int64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_micro(int64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__add_micros_maybe_localize(PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__datetime_from_seconds(int64_t); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__sequence_to_array(PyObject *, PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *,  arrow::MemoryPool *, bool); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *); /*proto*/
static std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib__ndarray_to_type(PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__ndarray_to_array(PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *, bool, bool,  arrow::MemoryPool *); /*proto*/
static Py_ssize_t __pyx_f_7pyarrow_3lib__normalize_index(Py_ssize_t, Py_ssize_t); /*proto*/
static  arrow::compute::FunctionContext *__pyx_f_7pyarrow_3lib__context(void); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_wrap_datum( arrow::compute::Datum const &); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__append_array_buffers( arrow::ArrayData const *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__reduce_array_data( arrow::ArrayData const *); /*proto*/
static std::shared_ptr< arrow::ArrayData>  __pyx_f_7pyarrow_3lib__reconstruct_array_data(PyObject *); /*proto*/
static arrow::py::PandasOptions __pyx_f_7pyarrow_3lib__convert_pandas_options(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_series_values(PyObject *, int *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__schema_from_arrays(PyObject *, PyObject *, PyObject *, std::shared_ptr< arrow::Schema>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__sanitize_arrays(PyObject *, PyObject *, PyObject *, PyObject *, std::shared_ptr< arrow::Schema>  *); /*proto*/
static std::shared_ptr< arrow::ResizableBuffer>  __pyx_f_7pyarrow_3lib__allocate_buffer( arrow::MemoryPool *); /*proto*/
static std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_as_c_buffer(PyObject *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib__get_native_file(PyObject *, bool); /*proto*/
static enum  arrow::Compression::type __pyx_f_7pyarrow_3lib__get_compression_type(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__get_input_stream(PyObject *, std::shared_ptr<arrow::io::InputStream>  *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib_as_native_file(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_buffer(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_data_type(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_field(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_schema(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_array(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(std::shared_ptr< arrow::Scalar>  const &); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_tensor(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_coo(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_csr(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_table(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_batch(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(struct __pyx_obj_7pyarrow_3lib_Scalar *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(struct __pyx_obj_7pyarrow_3lib_SerializationContext *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
static PyObject *__pyx_convert_vector_to_py_uint8_t(const std::vector<uint8_t>  &); /*proto*/
static std::unordered_set<std::string>  __pyx_convert_unordered_set_from_py_std_3a__3a_string(PyObject *); /*proto*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(const std::vector<std::string>  &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_int64_t(const std::vector<int64_t>  &); /*proto*/
static std::unordered_map<std::string,std::string>  __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "pyarrow.lib"
extern int __pyx_module_is_main_pyarrow__lib;
int __pyx_module_is_main_pyarrow__lib = 0;

/* Implementation of 'pyarrow.lib' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_UserWarning;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_FutureWarning;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_BufferError;
static PyObject *__pyx_builtin_SystemError;
static PyObject *__pyx_builtin_EOFError;
static const char __pyx_k_B[] = "B";
static const char __pyx_k_F[] = "F";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_K[] = "K";
static const char __pyx_k_Q[] = "Q";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_o[] = "o";
static const char __pyx_k_q[] = "q";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_NA[] = "NA";
static const char __pyx_k__2[] = "*";
static const char __pyx_k__3[] = "_";
static const char __pyx_k_ab[] = "ab";
static const char __pyx_k_ad[] = "ad";
static const char __pyx_k_df[] = "df";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_e2[] = "e2";
static const char __pyx_k_f2[] = "f2";
static const char __pyx_k_f4[] = "f4";
static const char __pyx_k_f8[] = "f8";
static const char __pyx_k_gz[] = ".gz";
static const char __pyx_k_i1[] = "i1";
static const char __pyx_k_i2[] = "i2";
static const char __pyx_k_i4[] = "i4";
static const char __pyx_k_i8[] = "i8";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_io[] = "io";
static const char __pyx_k_ma[] = "ma";
static const char __pyx_k_ms[] = "ms";
static const char __pyx_k_nf[] = "nf";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_ns[] = "ns";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_pd[] = "pd";
static const char __pyx_k_rb[] = "rb+";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_tb[] = "tb";
static const char __pyx_k_tz[] = "tz";
static const char __pyx_k_u1[] = "u1";
static const char __pyx_k_u2[] = "u2";
static const char __pyx_k_u4[] = "u4";
static const char __pyx_k_u8[] = "u8";
static const char __pyx_k_us[] = "us";
static const char __pyx_k_wb[] = "wb";
static const char __pyx_k_0_1[] = "{0}\n{1}";
static const char __pyx_k_PY3[] = "PY3";
static const char __pyx_k__10[] = "=";
static const char __pyx_k__27[] = "+";
static const char __pyx_k__28[] = "-";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_api[] = "api";
static const char __pyx_k_arr[] = "arr";
static const char __pyx_k_buf[] = "buf";
static const char __pyx_k_bz2[] = "bz2";
static const char __pyx_k_cat[] = "cat";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_col[] = "col";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lib[] = "lib";
static const char __pyx_k_lz4[] = "lz4";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_mro[] = "__mro__";
static const char __pyx_k_nan[] = "nan";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_r_2[] = "r+";
static const char __pyx_k_r_b[] = "r+b";
static const char __pyx_k_ref[] = "ref";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_six[] = "six";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_typ[] = "typ";
static const char __pyx_k_utc[] = "utc";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_zst[] = ".zst";
static const char __pyx_k_0_25[] = "0.25";
static const char __pyx_k_Full[] = "Full";
static const char __pyx_k_NULL[] = "NULL";
static const char __pyx_k_None[] = "None";
static const char __pyx_k__181[] = "";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_body[] = "body";
static const char __pyx_k_bool[] = "bool_";
static const char __pyx_k_cast[] = "cast";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_core[] = "core";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_days[] = "days";
static const char __pyx_k_dest[] = "dest";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_full[] = "full";
static const char __pyx_k_gzip[] = "gzip";
static const char __pyx_k_hint[] = "hint";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_int8[] = "int8";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_kind[] = "kind";
static const char __pyx_k_list[] = "list_";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mask[] = "mask";
static const char __pyx_k_mmap[] = "mmap";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_null[] = "null";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_pool[] = "pool";
static const char __pyx_k_port[] = "port";
static const char __pyx_k_pytz[] = "pytz";
static const char __pyx_k_rb_2[] = "rb";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_safe[] = "safe";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sign[] = "sign";
static const char __pyx_k_sink[] = "sink";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_take[] = "take";
static const char __pyx_k_tell[] = "tell";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_unit[] = "unit";
static const char __pyx_k_user[] = "user";
static const char __pyx_k_utf8[] = "utf8";
static const char __pyx_k_util[] = "util";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_zone[] = "zone";
static const char __pyx_k_zstd[] = "zstd";
static const char __pyx_k_Array[] = "Array";
static const char __pyx_k_Empty[] = "Empty";
static const char __pyx_k_Field[] = "Field";
static const char __pyx_k_Index[] = "Index";
static const char __pyx_k_Queue[] = "Queue";
static const char __pyx_k_Table[] = "Table";
static const char __pyx_k_alias[] = "alias";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_as_py[] = "as_py";
static const char __pyx_k_bases[] = "__bases__";
static const char __pyx_k_batch[] = "batch";
static const char __pyx_k_bz2_2[] = ".bz2";
static const char __pyx_k_c_buf[] = "c_buf";
static const char __pyx_k_child[] = "child";
static const char __pyx_k_chunk[] = "chunk";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_codec[] = "codec";
static const char __pyx_k_codes[] = "codes";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_cpool[] = "cpool";
static const char __pyx_k_dense[] = "dense";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_field[] = "field";
static const char __pyx_k_float[] = "float";
static const char __pyx_k_group[] = "group";
static const char __pyx_k_hours[] = "hours";
static const char __pyx_k_int16[] = "int16";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_int64[] = "int64";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_level[] = "level";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_lz4_2[] = ".lz4";
static const char __pyx_k_match[] = "match";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_owner[] = "owner";
static const char __pyx_k_pybuf[] = "pybuf";
static const char __pyx_k_pyobj[] = "pyobj";
static const char __pyx_k_qsize[] = "qsize";
static const char __pyx_k_queue[] = "queue";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_scale[] = "scale";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_sleep[] = "sleep";
static const char __pyx_k_slice[] = "slice";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_str_2[] = "str";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_table[] = "table";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_uint8[] = "uint8";
static const char __pyx_k_union[] = "union";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_0_19_0[] = "0.19.0";
static const char __pyx_k_0_20_0[] = "0.20.0";
static const char __pyx_k_0_23_0[] = "0.23.0";
static const char __pyx_k_Buffer[] = "Buffer";
static const char __pyx_k_IOBase[] = "IOBase";
static const char __pyx_k_NAType[] = "NAType";
static const char __pyx_k_NULL_2[] = "_NULL";
static const char __pyx_k_OSFile[] = "OSFile";
static const char __pyx_k_Scalar[] = "Scalar";
static const char __pyx_k_Schema[] = "Schema";
static const char __pyx_k_Series[] = "Series";
static const char __pyx_k_Tensor[] = "Tensor";
static const char __pyx_k_Thread[] = "Thread";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arrays[] = "arrays";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_atexit[] = "atexit";
static const char __pyx_k_binary[] = "binary";
static const char __pyx_k_bool_2[] = "bool";
static const char __pyx_k_brotli[] = "brotli";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_c_addr[] = "c_addr";
static const char __pyx_k_c_meta[] = "c_meta";
static const char __pyx_k_c_path[] = "c_path";
static const char __pyx_k_c_size[] = "c_size";
static const char __pyx_k_c_type[] = "c_type";
static const char __pyx_k_chunks[] = "chunks";
static const char __pyx_k_client[] = "client";
static const char __pyx_k_closed[] = "closed";
static const char __pyx_k_column[] = "column";
static const char __pyx_k_common[] = "common";
static const char __pyx_k_compat[] = "compat";
static const char __pyx_k_coords[] = "coords";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_date32[] = "date32";
static const char __pyx_k_date64[] = "date64";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_detect[] = "detect";
static const char __pyx_k_double[] = "double";
static const char __pyx_k_driver[] = "driver";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_equals[] = "equals";
static const char __pyx_k_exc_tb[] = "exc_tb";
static const char __pyx_k_fields[] = "fields";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_handle[] = "handle";
static const char __pyx_k_hdfs_d[] = "hdfs://(.*):(\\d+)(.*)";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_indent[] = "indent";
static const char __pyx_k_indptr[] = "indptr";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_micros[] = "micros";
static const char __pyx_k_millis[] = "millis";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_nbytes[] = "nbytes";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_open_2[] = "_open";
static const char __pyx_k_pandas[] = "pandas";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_pprint[] = "pprint";
static const char __pyx_k_pytype[] = "_pytype_";
static const char __pyx_k_reader[] = "reader";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_resize[] = "resize";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_schema[] = "schema";
static const char __pyx_k_series[] = "series";
static const char __pyx_k_skipna[] = "skipna";
static const char __pyx_k_snappy[] = "snappy";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_sparse[] = "sparse";
static const char __pyx_k_stream[] = "stream";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_tables[] = "tables";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_tensor[] = "tensor";
static const char __pyx_k_time32[] = "time32";
static const char __pyx_k_time64[] = "time64";
static const char __pyx_k_type_2[] = "type ";
static const char __pyx_k_type_3[] = "type_";
static const char __pyx_k_type_4[] = "_type";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_uint16[] = "uint16";
static const char __pyx_k_uint32[] = "uint32";
static const char __pyx_k_uint64[] = "uint64";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_upload[] = "upload";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_whence[] = "whence";
static const char __pyx_k_window[] = "window";
static const char __pyx_k_02d_02d[] = "{}{:02d}:{:02d}";
static const char __pyx_k_Decimal[] = "Decimal";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_Mapping[] = "Mapping";
static const char __pyx_k_Message[] = "Message";
static const char __pyx_k_Type_ID[] = "Type ID ";
static const char __pyx_k_Type_NA[] = "Type_NA";
static const char __pyx_k_address[] = "address";
static const char __pyx_k_asarray[] = "asarray";
static const char __pyx_k_asbytes[] = "asbytes";
static const char __pyx_k_batches[] = "batches";
static const char __pyx_k_boolean[] = "boolean";
static const char __pyx_k_buffers[] = "buffers";
static const char __pyx_k_c_array[] = "c_array";
static const char __pyx_k_c_codec[] = "c_codec";
static const char __pyx_k_c_names[] = "c_names";
static const char __pyx_k_c_shape[] = "c_shape";
static const char __pyx_k_c_table[] = "c_table";
static const char __pyx_k_cleanup[] = "cleanup";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_context[] = "context";
static const char __pyx_k_ctensor[] = "ctensor";
static const char __pyx_k_decimal[] = "decimal";
static const char __pyx_k_exc_val[] = "exc_val";
static const char __pyx_k_field_2[] = "_field";
static const char __pyx_k_field_3[] = "field_";
static const char __pyx_k_flatten[] = "flatten";
static const char __pyx_k_float16[] = "float16";
static const char __pyx_k_float32[] = "float32";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_fromutc[] = "fromutc";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_libhdfs[] = "libhdfs";
static const char __pyx_k_mapping[] = "mapping";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_minutes[] = "minutes";
static const char __pyx_k_ndarray[] = "ndarray";
static const char __pyx_k_offsets[] = "offsets";
static const char __pyx_k_options[] = "options";
static const char __pyx_k_ordered[] = "ordered";
static const char __pyx_k_out_buf[] = "out_buf";
static const char __pyx_k_pformat[] = "pformat";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_pyarrow[] = "pyarrow.{}\n{}";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_require[] = "require";
static const char __pyx_k_seconds[] = "seconds";
static const char __pyx_k_storage[] = "storage";
static const char __pyx_k_testing[] = "testing";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_tobytes[] = "tobytes";
static const char __pyx_k_type_id[] = "type_id";
static const char __pyx_k_version[] = "__version__";
static const char __pyx_k_weakref[] = "weakref";
static const char __pyx_k_DataType[] = "DataType";
static const char __pyx_k_EOFError[] = "EOFError";
static const char __pyx_k_HdfsFile[] = "HdfsFile";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_ListType[] = "ListType";
static const char __pyx_k_NullType[] = "NullType";
static const char __pyx_k_Type_MAP[] = "Type_MAP";
static const char __pyx_k_bBhHiIqQ[] = "bBhHiIqQ";
static const char __pyx_k_bg_write[] = "bg_write";
static const char __pyx_k_c_arrays[] = "c_arrays";
static const char __pyx_k_c_fields[] = "c_fields";
static const char __pyx_k_c_result[] = "c_result";
static const char __pyx_k_c_schema[] = "c_schema";
static const char __pyx_k_c_stream[] = "c_stream";
static const char __pyx_k_c_tables[] = "c_tables";
static const char __pyx_k_children[] = "children";
static const char __pyx_k_column_2[] = "_column";
static const char __pyx_k_compress[] = "compress";
static const char __pyx_k_cpp_file[] = "cpp_file";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_decay_ms[] = "decay_ms";
static const char __pyx_k_download[] = "download";
static const char __pyx_k_endswith[] = "endswith";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_exc_type[] = "exc_type";
static const char __pyx_k_ext_type[] = "ext_type";
static const char __pyx_k_fastpath[] = "fastpath";
static const char __pyx_k_fields_2[] = "_fields";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_getvalue[] = "getvalue";
static const char __pyx_k_is_alive[] = "is_alive";
static const char __pyx_k_libhdfs3[] = "libhdfs3";
static const char __pyx_k_metadata[] = "metadata";
static const char __pyx_k_new_path[] = "new_path";
static const char __pyx_k_new_size[] = "new_size";
static const char __pyx_k_nthreads[] = "nthreads";
static const char __pyx_k_nullable[] = "nullable";
static const char __pyx_k_num_rows[] = "num_rows";
static const char __pyx_k_object_2[] = "object_";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_py_field[] = "py_field";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_readable[] = "readable";
static const char __pyx_k_readline[] = "readline";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_time32_s[] = "time32[s]";
static const char __pyx_k_timezone[] = "timezone";
static const char __pyx_k_truncate[] = "truncate";
static const char __pyx_k_validate[] = "validate";
static const char __pyx_k_values_2[] = "_values";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_writable[] = "writable";
static const char __pyx_k_write_to[] = "write_to";
static const char __pyx_k_DataFrame[] = "DataFrame";
static const char __pyx_k_Int8Array[] = "Int8Array";
static const char __pyx_k_Int8Value[] = "Int8Value";
static const char __pyx_k_ListArray[] = "ListArray";
static const char __pyx_k_ListValue[] = "ListValue";
static const char __pyx_k_NullArray[] = "NullArray";
static const char __pyx_k_QueueFull[] = "QueueFull";
static const char __pyx_k_Timestamp[] = "Timestamp";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_Type_BOOL[] = "Type_BOOL";
static const char __pyx_k_Type_INT8[] = "Type_INT8";
static const char __pyx_k_Type_LIST[] = "Type_LIST";
static const char __pyx_k_UnionType[] = "UnionType";
static const char __pyx_k_alignment[] = "alignment";
static const char __pyx_k_arrow_obj[] = "arrow_obj";
static const char __pyx_k_as_buffer[] = "as_buffer";
static const char __pyx_k_bit_width[] = "bit_width";
static const char __pyx_k_c_batches[] = "c_batches";
static const char __pyx_k_c_buffers[] = "c_buffers";
static const char __pyx_k_c_options[] = "c_options";
static const char __pyx_k_c_ordered[] = "c_ordered";
static const char __pyx_k_chunksize[] = "chunksize";
static const char __pyx_k_cpu_count[] = "cpu_count";
static const char __pyx_k_date64_ms[] = "date64[ms]";
static const char __pyx_k_dim_names[] = "dim_names";
static const char __pyx_k_directory[] = "directory";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_exc_value[] = "exc_value";
static const char __pyx_k_ext_array[] = "ext_array";
static const char __pyx_k_file_type[] = "file_type";
static const char __pyx_k_frombytes[] = "frombytes";
static const char __pyx_k_full_info[] = "full_info";
static const char __pyx_k_get_batch[] = "get_batch";
static const char __pyx_k_halffloat[] = "halffloat";
static const char __pyx_k_in_stream[] = "in_stream";
static const char __pyx_k_indices_2[] = "_indices";
static const char __pyx_k_is_series[] = "is_series";
static const char __pyx_k_is_sparse[] = "is_sparse";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_large_str[] = "large_str";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_offsets_2[] = "_offsets";
static const char __pyx_k_owned_buf[] = "owned_buf";
static const char __pyx_k_precision[] = "precision";
static const char __pyx_k_py_buffer[] = "py_buffer";
static const char __pyx_k_pyarrow_2[] = "pyarrow";
static const char __pyx_k_pydecimal[] = "_pydecimal";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_readlines[] = "readlines";
static const char __pyx_k_recursive[] = "recursive";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_resizable[] = "resizable";
static const char __pyx_k_rz_buffer[] = "rz_buffer";
static const char __pyx_k_serialize[] = "serialize";
static const char __pyx_k_sp_tensor[] = "sp_tensor";
static const char __pyx_k_temp_memo[] = "temp_memo";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_time32_ms[] = "time32[ms]";
static const char __pyx_k_time64_ns[] = "time64[ns]";
static const char __pyx_k_time64_us[] = "time64[us]";
static const char __pyx_k_timedelta[] = "timedelta";
static const char __pyx_k_timestamp[] = "timestamp";
static const char __pyx_k_to_pandas[] = "_to_pandas";
static const char __pyx_k_to_pylist[] = "to_pylist";
static const char __pyx_k_type_name[] = "type_name";
static const char __pyx_k_unit_code[] = "unit_code";
static const char __pyx_k_utcoffset[] = "utcoffset";
static const char __pyx_k_ArrayValue[] = "ArrayValue";
static const char __pyx_k_BaseTzInfo[] = "BaseTzInfo";
static const char __pyx_k_FloatArray[] = "FloatArray";
static const char __pyx_k_FloatValue[] = "FloatValue";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_Int16Array[] = "Int16Array";
static const char __pyx_k_Int16Value[] = "Int16Value";
static const char __pyx_k_Int32Array[] = "Int32Array";
static const char __pyx_k_Int32Value[] = "Int32Value";
static const char __pyx_k_Int64Array[] = "Int64Array";
static const char __pyx_k_Int64Value[] = "Int64Value";
static const char __pyx_k_Int8Scalar[] = "Int8Scalar";
static const char __pyx_k_MemoryPool[] = "MemoryPool";
static const char __pyx_k_NativeFile[] = "NativeFile";
static const char __pyx_k_PythonFile[] = "PythonFile";
static const char __pyx_k_QueueEmpty[] = "QueueEmpty";
static const char __pyx_k_StructType[] = "StructType";
static const char __pyx_k_TextIOBase[] = "TextIOBase";
static const char __pyx_k_Time32Type[] = "Time32Type";
static const char __pyx_k_Time64Type[] = "Time64Type";
static const char __pyx_k_Type_FLOAT[] = "Type_FLOAT";
static const char __pyx_k_Type_INT16[] = "Type_INT16";
static const char __pyx_k_Type_INT32[] = "Type_INT32";
static const char __pyx_k_Type_INT64[] = "Type_INT64";
static const char __pyx_k_Type_UINT8[] = "Type_UINT8";
static const char __pyx_k_Type_UNION[] = "Type_UNION";
static const char __pyx_k_UInt8Array[] = "UInt8Array";
static const char __pyx_k_UInt8Value[] = "UInt8Value";
static const char __pyx_k_UnionArray[] = "UnionArray";
static const char __pyx_k_UnionValue[] = "UnionValue";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_add_column[] = "add_column";
static const char __pyx_k_array_data[] = "array_data";
static const char __pyx_k_block_size[] = "block_size";
static const char __pyx_k_byte_width[] = "byte_width";
static const char __pyx_k_c_timezone[] = "c_timezone";
static const char __pyx_k_categories[] = "categories";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_compressor[] = "compressor";
static const char __pyx_k_data_frame[] = "data_frame";
static const char __pyx_k_date32_day[] = "date32[day]";
static const char __pyx_k_decimal128[] = "decimal128";
static const char __pyx_k_decompress[] = "decompress";
static const char __pyx_k_dictionary[] = "dictionary";
static const char __pyx_k_extensions[] = "extensions";
static const char __pyx_k_extra_conf[] = "extra_conf";
static const char __pyx_k_from_dense[] = "from_dense";
static const char __pyx_k_from_numpy[] = "from_numpy";
static const char __pyx_k_frombuffer[] = "frombuffer";
static const char __pyx_k_getnewargs[] = "__getnewargs__";
static const char __pyx_k_index_type[] = "index_type";
static const char __pyx_k_infer_type[] = "infer_type";
static const char __pyx_k_iterchunks[] = "iterchunks";
static const char __pyx_k_large_list[] = "large_list";
static const char __pyx_k_large_utf8[] = "large_utf8";
static const char __pyx_k_memory_map[] = "memory_map";
static const char __pyx_k_memoryview[] = "memoryview";
static const char __pyx_k_metadata_2[] = "\nmetadata\n--------\n";
static const char __pyx_k_null_count[] = "null_count";
static const char __pyx_k_num_arrays[] = "num_arrays";
static const char __pyx_k_num_chunks[] = "num_chunks";
static const char __pyx_k_pandas_api[] = "_pandas_api";
static const char __pyx_k_put_nowait[] = "put_nowait";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_result_obj[] = "result_obj";
static const char __pyx_k_serialized[] = "serialized";
static const char __pyx_k_serializer[] = "serializer";
static const char __pyx_k_stacklevel[] = "stacklevel";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_to_pybytes[] = "to_pybytes";
static const char __pyx_k_type_codes[] = "type_codes";
static const char __pyx_k_union_type[] = "union_type";
static const char __pyx_k_value_type[] = "value_type";
static const char __pyx_k_BinaryArray[] = "BinaryArray";
static const char __pyx_k_BinaryValue[] = "BinaryValue";
static const char __pyx_k_BufferError[] = "BufferError";
static const char __pyx_k_Categorical[] = "Categorical";
static const char __pyx_k_Date32Array[] = "Date32Array";
static const char __pyx_k_Date32Value[] = "Date32Value";
static const char __pyx_k_Date64Array[] = "Date64Array";
static const char __pyx_k_Date64Value[] = "Date64Value";
static const char __pyx_k_DoubleArray[] = "DoubleArray";
static const char __pyx_k_DoubleValue[] = "DoubleValue";
static const char __pyx_k_FixedOffset[] = "_FixedOffset";
static const char __pyx_k_FloatScalar[] = "FloatScalar";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Int16Scalar[] = "Int16Scalar";
static const char __pyx_k_Int32Scalar[] = "Int32Scalar";
static const char __pyx_k_Int64Scalar[] = "Int64Scalar";
static const char __pyx_k_MaskedArray[] = "MaskedArray";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_RecordBatch[] = "RecordBatch";
static const char __pyx_k_ScalarValue[] = "ScalarValue";
static const char __pyx_k_StringArray[] = "StringArray";
static const char __pyx_k_StringValue[] = "StringValue";
static const char __pyx_k_StructArray[] = "StructArray";
static const char __pyx_k_StructValue[] = "StructValue";
static const char __pyx_k_SystemError[] = "SystemError";
static const char __pyx_k_Time32Array[] = "Time32Array";
static const char __pyx_k_Time32Value[] = "Time32Value";
static const char __pyx_k_Time64Array[] = "Time64Array";
static const char __pyx_k_Time64Value[] = "Time64Value";
static const char __pyx_k_Type_BINARY[] = "Type_BINARY";
static const char __pyx_k_Type_DATE32[] = "Type_DATE32";
static const char __pyx_k_Type_DATE64[] = "Type_DATE64";
static const char __pyx_k_Type_DOUBLE[] = "Type_DOUBLE";
static const char __pyx_k_Type_STRING[] = "Type_STRING";
static const char __pyx_k_Type_STRUCT[] = "Type_STRUCT";
static const char __pyx_k_Type_TIME32[] = "Type_TIME32";
static const char __pyx_k_Type_TIME64[] = "Type_TIME64";
static const char __pyx_k_Type_UINT16[] = "Type_UINT16";
static const char __pyx_k_Type_UINT32[] = "Type_UINT32";
static const char __pyx_k_Type_UINT64[] = "Type_UINT64";
static const char __pyx_k_UInt16Array[] = "UInt16Array";
static const char __pyx_k_UInt16Value[] = "UInt16Value";
static const char __pyx_k_UInt32Array[] = "UInt32Array";
static const char __pyx_k_UInt32Value[] = "UInt32Value";
static const char __pyx_k_UInt64Array[] = "UInt64Array";
static const char __pyx_k_UInt64Value[] = "UInt64Value";
static const char __pyx_k_UInt8Scalar[] = "UInt8Scalar";
static const char __pyx_k_UserWarning[] = "UserWarning";
static const char __pyx_k_arrow_array[] = "__arrow_array__";
static const char __pyx_k_assert_open[] = "_assert_open";
static const char __pyx_k_binary_type[] = "binary_type";
static const char __pyx_k_body_length[] = "body_length";
static const char __pyx_k_buffer_size[] = "buffer_size";
static const char __pyx_k_c_dim_names[] = "c_dim_names";
static const char __pyx_k_c_type_name[] = "c_type_name";
static const char __pyx_k_child_field[] = "child_field";
static const char __pyx_k_compression[] = "compression";
static const char __pyx_k_deserialize[] = "deserialize";
static const char __pyx_k_field_names[] = "field_names";
static const char __pyx_k_file_handle[] = "file_handle";
static const char __pyx_k_from_arrays[] = "from_arrays";
static const char __pyx_k_from_pandas[] = "from_pandas";
static const char __pyx_k_from_pydict[] = "from_pydict";
static const char __pyx_k_from_sparse[] = "from_sparse";
static const char __pyx_k_from_tensor[] = "from_tensor";
static const char __pyx_k_have_pandas[] = "have_pandas";
static const char __pyx_k_index_value[] = "index_value";
static const char __pyx_k_infer_dtype[] = "infer_dtype";
static const char __pyx_k_itercolumns[] = "itercolumns";
static const char __pyx_k_kerb_ticket[] = "kerb_ticket";
static const char __pyx_k_memory_pool[] = "memory_pool";
static const char __pyx_k_microsecond[] = "microsecond";
static const char __pyx_k_null_bitmap[] = "null_bitmap";
static const char __pyx_k_num_buffers[] = "num_buffers";
static const char __pyx_k_num_columns[] = "num_columns";
static const char __pyx_k_num_tensors[] = "num_tensors";
static const char __pyx_k_open_stream[] = "open_stream";
static const char __pyx_k_output_size[] = "output_size";
static const char __pyx_k_permissions[] = "permissions";
static const char __pyx_k_pyarrow_lib[] = "pyarrow.lib";
static const char __pyx_k_read_schema[] = "read_schema";
static const char __pyx_k_read_tensor[] = "read_tensor";
static const char __pyx_k_replication[] = "replication";
static const char __pyx_k_source_path[] = "source_path";
static const char __pyx_k_struct_type[] = "struct_type";
static const char __pyx_k_target_type[] = "target_type";
static const char __pyx_k_timestamp_s[] = "timestamp[s]";
static const char __pyx_k_to_pandas_2[] = "to_pandas";
static const char __pyx_k_total_bytes[] = "total_bytes";
static const char __pyx_k_use_threads[] = "use_threads";
static const char __pyx_k_write_batch[] = "write_batch";
static const char __pyx_k_write_table[] = "write_table";
static const char __pyx_k_Array___iter[] = "Array.__iter__";
static const char __pyx_k_ArrowIOError[] = "ArrowIOError";
static const char __pyx_k_ArrowInvalid[] = "ArrowInvalid";
static const char __pyx_k_BooleanArray[] = "BooleanArray";
static const char __pyx_k_BooleanValue[] = "BooleanValue";
static const char __pyx_k_BufferReader[] = "BufferReader";
static const char __pyx_k_ChunkedArray[] = "ChunkedArray";
static const char __pyx_k_DecimalValue[] = "DecimalValue";
static const char __pyx_k_DoubleScalar[] = "DoubleScalar";
static const char __pyx_k_FeatherError[] = "FeatherError";
static const char __pyx_k_HDFS_PATH_RE[] = "_HDFS_PATH_RE";
static const char __pyx_k_IntegerArray[] = "IntegerArray";
static const char __pyx_k_LooseVersion[] = "LooseVersion";
static const char __pyx_k_NumericArray[] = "NumericArray";
static const char __pyx_k_PickleBuffer[] = "PickleBuffer";
static const char __pyx_k_Type_DECIMAL[] = "Type_DECIMAL";
static const char __pyx_k_UInt16Scalar[] = "UInt16Scalar";
static const char __pyx_k_UInt32Scalar[] = "UInt32Scalar";
static const char __pyx_k_UInt64Scalar[] = "UInt64Scalar";
static const char __pyx_k_c_child_data[] = "c_child_data";
static const char __pyx_k_c_type_codes[] = "c_type_codes";
static const char __pyx_k_cpy_ext_type[] = "cpy_ext_type";
static const char __pyx_k_deserializer[] = "deserializer";
static const char __pyx_k_dictionary_2[] = "_dictionary";
static const char __pyx_k_from_batches[] = "from_batches";
static const char __pyx_k_from_buffers[] = "from_buffers";
static const char __pyx_k_from_storage[] = "from_storage";
static const char __pyx_k_get_capacity[] = "get_capacity";
static const char __pyx_k_have_libhdfs[] = "have_libhdfs";
static const char __pyx_k_input_stream[] = "input_stream";
static const char __pyx_k_is_primitive[] = "_is_primitive";
static const char __pyx_k_large_binary[] = "large_binary";
static const char __pyx_k_large_string[] = "large_string";
static const char __pyx_k_microseconds[] = "microseconds";
static const char __pyx_k_milliseconds[] = "milliseconds";
static const char __pyx_k_num_children[] = "num_children";
static const char __pyx_k_num_ndarrays[] = "num_ndarrays";
static const char __pyx_k_ordered_dict[] = "ordered_dict";
static const char __pyx_k_pyarrow_util[] = "pyarrow.util";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_read_message[] = "read_message";
static const char __pyx_k_record_batch[] = "record_batch";
static const char __pyx_k_requirements[] = "requirements";
static const char __pyx_k_serialize_to[] = "serialize_to";
static const char __pyx_k_sp_data_type[] = "sp_data_type";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_storage_type[] = "storage_type";
static const char __pyx_k_string_types[] = "string_types";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_timestamp_ms[] = "timestamp[ms]";
static const char __pyx_k_timestamp_ns[] = "timestamp[ns]";
static const char __pyx_k_timestamp_us[] = "timestamp[us]";
static const char __pyx_k_uncompressed[] = "uncompressed";
static const char __pyx_k_write_tensor[] = "write_tensor";
static const char __pyx_k_ArrowKeyError[] = "ArrowKeyError";
static const char __pyx_k_ExtensionType[] = "ExtensionType";
static const char __pyx_k_FeatherReader[] = "FeatherReader";
static const char __pyx_k_FeatherWriter[] = "FeatherWriter";
static const char __pyx_k_FixedOffset_2[] = "FixedOffset";
static const char __pyx_k_FutureWarning[] = "FutureWarning";
static const char __pyx_k_HdfsFileNanny[] = "_HdfsFileNanny";
static const char __pyx_k_LargeListType[] = "LargeListType";
static const char __pyx_k_MessageReader[] = "MessageReader";
static const char __pyx_k_PandasAPIShim[] = "_PandasAPIShim";
static const char __pyx_k_Schema___iter[] = "Schema.__iter__";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_StringBuilder[] = "StringBuilder";
static const char __pyx_k_TimestampType[] = "TimestampType";
static const char __pyx_k_arg_dict_memo[] = "arg_dict_memo";
static const char __pyx_k_array_line_99[] = "array (line 99)";
static const char __pyx_k_c_field_names[] = "c_field_names";
static const char __pyx_k_c_from_pandas[] = "c_from_pandas";
static const char __pyx_k_chunked_array[] = "chunked_array";
static const char __pyx_k_concat_arrays[] = "concat_arrays";
static const char __pyx_k_concat_tables[] = "concat_tables";
static const char __pyx_k_datetime64_ns[] = "datetime64[ns]";
static const char __pyx_k_footer_offset[] = "footer_offset";
static const char __pyx_k_have_libhdfs3[] = "have_libhdfs3";
static const char __pyx_k_integer_types[] = "integer_types";
static const char __pyx_k_is_array_like[] = "is_array_like";
static const char __pyx_k_is_data_frame[] = "is_data_frame";
static const char __pyx_k_is_datetimetz[] = "is_datetimetz";
static const char __pyx_k_last_accessed[] = "last_accessed";
static const char __pyx_k_last_modified[] = "last_modified";
static const char __pyx_k_make_tz_aware[] = "make_tz_aware";
static const char __pyx_k_max_chunksize[] = "max_chunksize";
static const char __pyx_k_output_buffer[] = "output_buffer";
static const char __pyx_k_output_length[] = "output_length";
static const char __pyx_k_output_stream[] = "output_stream";
static const char __pyx_k_pa_getnewargs[] = "_pa_getnewargs_";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_remove_column[] = "remove_column";
static const char __pyx_k_restore_array[] = "_restore_array";
static const char __pyx_k_set_cpu_count[] = "set_cpu_count";
static const char __pyx_k_shrink_to_fit[] = "shrink_to_fit";
static const char __pyx_k_target_schema[] = "target_schema";
static const char __pyx_k_total_seconds[] = "total_seconds";
static const char __pyx_k_value_offsets[] = "value_offsets";
static const char __pyx_k_with_metadata[] = "with_metadata";
static const char __pyx_k_wrapped_value[] = "wrapped_value";
static const char __pyx_k_Array_was_NULL[] = "Array was NULL";
static const char __pyx_k_ArrowException[] = "ArrowException";
static const char __pyx_k_ArrowTypeError[] = "ArrowTypeError";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_BufferedIOBase[] = "BufferedIOBase";
static const char __pyx_k_Decimal128Type[] = "Decimal128Type";
static const char __pyx_k_DictionaryMemo[] = "DictionaryMemo";
static const char __pyx_k_DictionaryType[] = "DictionaryType";
static const char __pyx_k_ExtensionArray[] = "ExtensionArray";
static const char __pyx_k_HalfFloatArray[] = "HalfFloatArray";
static const char __pyx_k_HalfFloatValue[] = "HalfFloatValue";
static const char __pyx_k_LargeListArray[] = "LargeListArray";
static const char __pyx_k_LargeListValue[] = "LargeListValue";
static const char __pyx_k_NotImplemented[] = "NotImplemented";
static const char __pyx_k_TimestampArray[] = "TimestampArray";
static const char __pyx_k_TimestampValue[] = "TimestampValue";
static const char __pyx_k_Type_TIMESTAMP[] = "Type_TIMESTAMP";
static const char __pyx_k_builtin_pickle[] = "builtin_pickle";
static const char __pyx_k_check_metadata[] = "check_metadata";
static const char __pyx_k_csparse_tensor[] = "csparse_tensor";
static const char __pyx_k_date_as_object[] = "date_as_object";
static const char __pyx_k_example_object[] = "example_object";
static const char __pyx_k_extension_name[] = "extension_name";
static const char __pyx_k_foreign_buffer[] = "foreign_buffer";
static const char __pyx_k_get_space_used[] = "get_space_used";
static const char __pyx_k_is_categorical[] = "is_categorical";
static const char __pyx_k_is_float_value[] = "is_float_value";
static const char __pyx_k_is_named_tuple[] = "is_named_tuple";
static const char __pyx_k_preserve_index[] = "preserve_index";
static const char __pyx_k_pyarrow_compat[] = "pyarrow.compat";
static const char __pyx_k_pyarrow_io_pxi[] = "pyarrow/io.pxi";
static const char __pyx_k_registry_nanny[] = "_registry_nanny";
static const char __pyx_k_stream_or_path[] = "stream_or_path";
static const char __pyx_k_stringify_path[] = "_stringify_path";
static const char __pyx_k_type_for_alias[] = "type_for_alias";
static const char __pyx_k_use_memory_map[] = "use_memory_map";
static const char __pyx_k_zero_copy_only[] = "zero_copy_only";
static const char __pyx_k_ArrowIndexError[] = "ArrowIndexError";
static const char __pyx_k_DatetimeTZDtype[] = "DatetimeTZDtype";
static const char __pyx_k_Decimal128Array[] = "Decimal128Array";
static const char __pyx_k_DictionaryArray[] = "DictionaryArray";
static const char __pyx_k_DictionaryValue[] = "DictionaryValue";
static const char __pyx_k_FIXED_OFFSET_RE[] = "_FIXED_OFFSET_RE";
static const char __pyx_k_FunctionContext[] = "_FunctionContext";
static const char __pyx_k_ProxyMemoryPool[] = "ProxyMemoryPool";
static const char __pyx_k_PyExtensionType[] = "PyExtensionType";
static const char __pyx_k_ResizableBuffer[] = "ResizableBuffer";
static const char __pyx_k_Scalar_was_NULL[] = "Scalar was NULL";
static const char __pyx_k_SparseTensorCOO[] = "SparseTensorCOO";
static const char __pyx_k_SparseTensorCSR[] = "SparseTensorCSR";
static const char __pyx_k_Tensor_was_NULL[] = "Tensor was NULL";
static const char __pyx_k_Type_DICTIONARY[] = "Type_DICTIONARY";
static const char __pyx_k_Type_HALF_FLOAT[] = "Type_HALF_FLOAT";
static const char __pyx_k_Type_LARGE_LIST[] = "Type_LARGE_LIST";
static const char __pyx_k_UnionMode_DENSE[] = "UnionMode_DENSE";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_assert_readable[] = "_assert_readable";
static const char __pyx_k_assert_seekable[] = "_assert_seekable";
static const char __pyx_k_assert_writable[] = "_assert_writable";
static const char __pyx_k_children_fields[] = "children_fields";
static const char __pyx_k_dictionary_memo[] = "dictionary_memo";
static const char __pyx_k_file_descriptor[] = "file_descriptor";
static const char __pyx_k_from_components[] = "from_components";
static const char __pyx_k_get_field_index[] = "get_field_index";
static const char __pyx_k_get_tensor_size[] = "get_tensor_size";
static const char __pyx_k_got_null_buffer[] = "got null buffer";
static const char __pyx_k_ignore_metadata[] = "ignore_metadata";
static const char __pyx_k_make_datetimetz[] = "make_datetimetz";
static const char __pyx_k_max_output_size[] = "max_output_size";
static const char __pyx_k_metadata_length[] = "metadata_length";
static const char __pyx_k_normalize_slice[] = "_normalize_slice";
static const char __pyx_k_pyarrow_Field_0[] = "pyarrow.Field<{0}>";
static const char __pyx_k_pyarrow_ipc_pxi[] = "pyarrow/ipc.pxi";
static const char __pyx_k_pyarrow_lib_pyx[] = "pyarrow/lib.pyx";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_read_next_batch[] = "read_next_batch";
static const char __pyx_k_read_serialized[] = "read_serialized";
static const char __pyx_k_set_memory_pool[] = "set_memory_pool";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_table_to_blocks[] = "table_to_blocks";
static const char __pyx_k_to_pandas_dtype[] = "to_pandas_dtype";
static const char __pyx_k_ArrowMemoryError[] = "ArrowMemoryError";
static const char __pyx_k_HadoopFileSystem[] = "HadoopFileSystem";
static const char __pyx_k_LargeBinaryArray[] = "LargeBinaryArray";
static const char __pyx_k_LargeBinaryValue[] = "LargeBinaryValue";
static const char __pyx_k_LargeStringArray[] = "LargeStringArray";
static const char __pyx_k_LargeStringValue[] = "LargeStringValue";
static const char __pyx_k_ListValue___iter[] = "ListValue.__iter__";
static const char __pyx_k_MemoryMappedFile[] = "MemoryMappedFile";
static const char __pyx_k_MockOutputStream[] = "MockOutputStream";
static const char __pyx_k_UnionMode_SPARSE[] = "UnionMode_SPARSE";
static const char __pyx_k_UnionType___iter[] = "UnionType.__iter__";
static const char __pyx_k_c_extension_name[] = "c_extension_name";
static const char __pyx_k_categorical_type[] = "categorical_type";
static const char __pyx_k_converted_arrays[] = "converted_arrays";
static const char __pyx_k_deserialize_from[] = "deserialize_from";
static const char __pyx_k_dictionary_value[] = "dictionary_value";
static const char __pyx_k_encode_file_path[] = "encode_file_path";
static const char __pyx_k_from_dense_numpy[] = "from_dense_numpy";
static const char __pyx_k_from_numpy_dtype[] = "from_numpy_dtype";
static const char __pyx_k_get_record_batch[] = "get_record_batch";
static const char __pyx_k_is_boolean_value[] = "is_boolean_value";
static const char __pyx_k_is_integer_value[] = "is_integer_value";
static const char __pyx_k_is_pandas_object[] = "is_pandas_object";
static const char __pyx_k_last_access_time[] = "last_access_time";
static const char __pyx_k_pandas_api_types[] = "pandas.api.types";
static const char __pyx_k_release_registry[] = "release_registry";
static const char __pyx_k_sp_chunked_array[] = "sp_chunked_array";
static const char __pyx_k_string_to_tzinfo[] = "string_to_tzinfo";
static const char __pyx_k_tzinfo_to_string[] = "tzinfo_to_string";
static const char __pyx_k_unknown_driver_r[] = "unknown driver: %r";
static const char __pyx_k_BaseExtensionType[] = "BaseExtensionType";
static const char __pyx_k_LoggingMemoryPool[] = "LoggingMemoryPool";
static const char __pyx_k_PandasConvertible[] = "_PandasConvertible";
static const char __pyx_k_StructType___iter[] = "StructType.__iter__";
static const char __pyx_k_Table_itercolumns[] = "Table.itercolumns";
static const char __pyx_k_Type_LARGE_BINARY[] = "Type_LARGE_BINARY";
static const char __pyx_k_Type_LARGE_STRING[] = "Type_LARGE_STRING";
static const char __pyx_k_create_memory_map[] = "create_memory_map";
static const char __pyx_k_custom_serializer[] = "custom_serializer";
static const char __pyx_k_decompressed_size[] = "decompressed_size";
static const char __pyx_k_distutils_version[] = "distutils.version";
static const char __pyx_k_proxy_memory_pool[] = "proxy_memory_pool";
static const char __pyx_k_pyarrow_array_pxi[] = "pyarrow/array.pxi";
static const char __pyx_k_pyarrow_error_pxi[] = "pyarrow/error.pxi";
static const char __pyx_k_pyarrow_table_pxi[] = "pyarrow/table.pxi";
static const char __pyx_k_pyarrow_types_pxi[] = "pyarrow/types.pxi";
static const char __pyx_k_read_next_message[] = "read_next_message";
static const char __pyx_k_read_record_batch[] = "read_record_batch";
static const char __pyx_k_reconstruct_table[] = "_reconstruct_table";
static const char __pyx_k_use_legacy_format[] = "use_legacy_format";
static const char __pyx_k_ArrowCapacityError[] = "ArrowCapacityError";
static const char __pyx_k_BufferOutputStream[] = "BufferOutputStream";
static const char __pyx_k_CRecordBatchReader[] = "_CRecordBatchReader";
static const char __pyx_k_CRecordBatchWriter[] = "_CRecordBatchWriter";
static const char __pyx_k_Column_r_not_found[] = "Column {!r} not found";
static const char __pyx_k_FloatingPointArray[] = "FloatingPointArray";
static const char __pyx_k_SerializedPyObject[] = "SerializedPyObject";
static const char __pyx_k_assert_frame_equal[] = "assert_frame_equal";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_dataframe_to_types[] = "dataframe_to_types";
static const char __pyx_k_default_block_size[] = "default_block_size";
static const char __pyx_k_detect_compression[] = "_detect_compression";
static const char __pyx_k_last_modified_time[] = "last_modified_time";
static const char __pyx_k_millis_to_datetime[] = "_millis_to_datetime";
static const char __pyx_k_num_record_batches[] = "num_record_batches";
static const char __pyx_k_pyarrow_memory_pxi[] = "pyarrow/memory.pxi";
static const char __pyx_k_pyarrow_scalar_pxi[] = "pyarrow/scalar.pxi";
static const char __pyx_k_pyarrow_tensor_pxi[] = "pyarrow/tensor.pxi";
static const char __pyx_k_strip_hdfs_abspath[] = "strip_hdfs_abspath";
static const char __pyx_k_Array_cast_line_517[] = "Array.cast (line 517)";
static const char __pyx_k_Array_take_line_817[] = "Array.take (line 817)";
static const char __pyx_k_ArrowKeyError___str[] = "ArrowKeyError.__str__";
static const char __pyx_k_BufferedInputStream[] = "BufferedInputStream";
static const char __pyx_k_ChunkedArray___iter[] = "ChunkedArray.__iter__";
static const char __pyx_k_DEFAULT_BUFFER_SIZE[] = "DEFAULT_BUFFER_SIZE";
static const char __pyx_k_End_of_Arrow_stream[] = "End of Arrow stream";
static const char __pyx_k_FixedSizeBinaryType[] = "FixedSizeBinaryType";
static const char __pyx_k_Invalid_file_mode_0[] = "Invalid file mode: {0}";
static const char __pyx_k_No_type_alias_for_0[] = "No type alias for {0}";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_categorical_columns[] = "categorical_columns";
static const char __pyx_k_custom_deserializer[] = "custom_deserializer";
static const char __pyx_k_dataframe_to_arrays[] = "dataframe_to_arrays";
static const char __pyx_k_deduplicate_objects[] = "deduplicate_objects";
static const char __pyx_k_default_memory_pool[] = "default_memory_pool";
static const char __pyx_k_get_datetimetz_type[] = "get_datetimetz_type";
static const char __pyx_k_get_default_context[] = "_get_default_context";
static const char __pyx_k_index_out_of_bounds[] = "index out of bounds";
static const char __pyx_k_logging_memory_pool[] = "logging_memory_pool";
static const char __pyx_k_pandas_types_dtypes[] = "pandas.types.dtypes";
static const char __pyx_k_pyarrow_io_hdfs_pxi[] = "pyarrow/io-hdfs.pxi";
static const char __pyx_k_pyx_unpickle_Scalar[] = "__pyx_unpickle_Scalar";
static const char __pyx_k_seconds_to_datetime[] = "_seconds_to_datetime";
static const char __pyx_k_set_memcopy_threads[] = "set_memcopy_threads";
static const char __pyx_k_BufferedOutputStream[] = "BufferedOutputStream";
static const char __pyx_k_FixedSizeBinaryArray[] = "FixedSizeBinaryArray";
static const char __pyx_k_FixedSizeBinaryValue[] = "FixedSizeBinaryValue";
static const char __pyx_k_MessageReader___iter[] = "MessageReader.__iter__";
static const char __pyx_k_Non_fixed_width_type[] = "Non-fixed width type";
static const char __pyx_k_SerializationContext[] = "SerializationContext";
static const char __pyx_k_UnknownExtensionType[] = "UnknownExtensionType";
static const char __pyx_k_UnsupportedOperation[] = "UnsupportedOperation";
static const char __pyx_k_integer_object_nulls[] = "integer_object_nulls";
static const char __pyx_k_use_pandas_sentinels[] = "use_pandas_sentinels";
static const char __pyx_k_Array_filter_line_860[] = "Array.filter (line 860)";
static const char __pyx_k_ChunkedArray_was_NULL[] = "ChunkedArray was NULL";
static const char __pyx_k_CompressedInputStream[] = "CompressedInputStream";
static const char __pyx_k_FixedSizeBufferWriter[] = "FixedSizeBufferWriter";
static const char __pyx_k_HDFS_client_is_closed[] = "HDFS client is closed";
static const char __pyx_k_LargeListValue___iter[] = "LargeListValue.__iter__";
static const char __pyx_k_RecordBatchFileReader[] = "_RecordBatchFileReader";
static const char __pyx_k_RecordBatchFileWriter[] = "_RecordBatchFileWriter";
static const char __pyx_k_arrow_ext_deserialize[] = "__arrow_ext_deserialize__";
static const char __pyx_k_get_record_batch_size[] = "get_record_batch_size";
static const char __pyx_k_jemalloc_set_decay_ms[] = "jemalloc_set_decay_ms";
static const char __pyx_k_ndarray_to_arrow_type[] = "_ndarray_to_arrow_type";
static const char __pyx_k_pyarrow_benchmark_pxi[] = "pyarrow/benchmark.pxi";
static const char __pyx_k_pyarrow_pandas_compat[] = "pyarrow.pandas_compat";
static const char __pyx_k_pyarrow_serialization[] = "pyarrow.serialization";
static const char __pyx_k_table_to_blockmanager[] = "table_to_blockmanager";
static const char __pyx_k_total_allocated_bytes[] = "total_allocated_bytes";
static const char __pyx_k_0___class_____name___0[] = "{0.__class__.__name__}({0})";
static const char __pyx_k_CompressedOutputStream[] = "CompressedOutputStream";
static const char __pyx_k_ExtensionRegistryNanny[] = "_ExtensionRegistryNanny";
static const char __pyx_k_Invalid_union_mode_0_r[] = "Invalid union mode {0!r}";
static const char __pyx_k_Type_FIXED_SIZE_BINARY[] = "Type_FIXED_SIZE_BINARY";
static const char __pyx_k_deserialize_components[] = "deserialize_components";
static const char __pyx_k_fixed_offset_to_string[] = "fixed_offset_to_string";
static const char __pyx_k_fixed_size_binary_type[] = "fixed_size_binary_type";
static const char __pyx_k_log_memory_allocations[] = "log_memory_allocations";
static const char __pyx_k_readable_file_expected[] = "readable file expected";
static const char __pyx_k_strings_to_categorical[] = "strings_to_categorical";
static const char __pyx_k_upload_locals_bg_write[] = "upload.<locals>.bg_write";
static const char __pyx_k_writable_file_expected[] = "writable file expected";
static const char __pyx_k_ArrowSerializationError[] = "ArrowSerializationError";
static const char __pyx_k_ChunkedArray_iterchunks[] = "ChunkedArray.iterchunks";
static const char __pyx_k_DataType_expected_got_r[] = "DataType expected, got {!r}";
static const char __pyx_k_Invalid_TimeUnit_string[] = "Invalid TimeUnit string";
static const char __pyx_k_RecordBatchStreamReader[] = "_RecordBatchStreamReader";
static const char __pyx_k_RecordBatchStreamWriter[] = "_RecordBatchStreamWriter";
static const char __pyx_k_arrow_py_extension_type[] = "arrow.py_extension_type";
static const char __pyx_k_download_locals_cleanup[] = "download.<locals>.cleanup";
static const char __pyx_k_register_extension_type[] = "register_extension_type";
static const char __pyx_k_Array_data_type_was_NULL[] = "Array data type was NULL";
static const char __pyx_k_ArrowNotImplementedError[] = "ArrowNotImplementedError";
static const char __pyx_k_Chunk_index_out_of_range[] = "Chunk index out of range.";
static const char __pyx_k_SparseTensorCOO_was_NULL[] = "SparseTensorCOO was NULL";
static const char __pyx_k_SparseTensorCSR_was_NULL[] = "SparseTensorCSR was NULL";
static const char __pyx_k_download_locals_bg_write[] = "download.<locals>.bg_write";
static const char __pyx_k_microseconds_to_datetime[] = "_microseconds_to_datetime";
static const char __pyx_k_reconstruct_record_batch[] = "_reconstruct_record_batch";
static const char __pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9[] = "([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$";
static const char __pyx_k_CRecordBatchReader___iter[] = "_CRecordBatchReader.__iter__";
static const char __pyx_k_Invalid_value_of_whence_0[] = "Invalid value of whence: {0}";
static const char __pyx_k_Scalar_data_type_was_NULL[] = "Scalar data type was NULL";
static const char __pyx_k_please_pass_it_explicitly[] = ", please pass it explicitly";
static const char __pyx_k_pyarrow_serialization_pxi[] = "pyarrow/serialization.pxi";
static const char __pyx_k_unregister_extension_type[] = "unregister_extension_type";
static const char __pyx_k_Failed_to_allocate_0_bytes[] = "Failed to allocate {0} bytes";
static const char __pyx_k_SerializationCallbackError[] = "SerializationCallbackError";
static const char __pyx_k_Table_from_pandas_line_998[] = "Table.from_pandas (line 998)";
static const char __pyx_k_register_py_extension_type[] = "_register_py_extension_type";
static const char __pyx_k_Batch_number_0_out_of_range[] = "Batch number {0} out of range";
static const char __pyx_k_Invalid_TimeUnit_for_time32[] = "Invalid TimeUnit for time32: {}";
static const char __pyx_k_Invalid_TimeUnit_for_time64[] = "Invalid TimeUnit for time64: {}";
static const char __pyx_k_Offset_must_be_non_negative[] = "Offset must be non-negative";
static const char __pyx_k_Please_implement_0___reduce[] = "Please implement {0}.__reduce__";
static const char __pyx_k_Schema_from_pandas_line_963[] = "Schema.from_pandas (line 963)";
static const char __pyx_k_default_context_initialized[] = "_default_context_initialized";
static const char __pyx_k_handle_arrow_array_protocol[] = "_handle_arrow_array_protocol";
static const char __pyx_k_pyarrow_Message_unitialized[] = "pyarrow.Message(unitialized)";
static const char __pyx_k_pyx_unpickle__PandasAPIShim[] = "__pyx_unpickle__PandasAPIShim";
static const char __pyx_k_DeserializationCallbackError[] = "DeserializationCallbackError";
static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file";
static const char __pyx_k_Indices_must_be_integer_type[] = "Indices must be integer type";
static const char __pyx_k_benchmark_PandasObjectIsNull[] = "benchmark_PandasObjectIsNull";
static const char __pyx_k_nanoseconds_to_datetime_safe[] = "_nanoseconds_to_datetime_safe";
static const char __pyx_k_only_valid_on_readonly_files[] = "only valid on readonly files";
static const char __pyx_k_only_valid_on_seekable_files[] = "only valid on seekable files";
static const char __pyx_k_only_valid_on_writable_files[] = "only valid on writable files";
static const char __pyx_k_Unrecognized_compression_type[] = "Unrecognized compression type: {}";
static const char __pyx_k_datetime_conversion_functions[] = "_datetime_conversion_functions";
static const char __pyx_k_default_serialization_context[] = "_default_serialization_context";
static const char __pyx_k_is_named_tuple_locals_genexpr[] = "is_named_tuple.<locals>.genexpr";
static const char __pyx_k_unregister_py_extension_types[] = "_unregister_py_extension_types";
static const char __pyx_k_Column_does_not_exist_in_table[] = "Column {} does not exist in table";
static const char __pyx_k_Convert_pandas_DataFrame_to_an[] = "\n        Convert pandas.DataFrame to an Arrow Table.\n\n        The column types in the resulting Arrow Table are inferred from the\n        dtypes of the pandas.Series in the DataFrame. In the case of non-object\n        Series, the NumPy dtype is translated to its Arrow equivalent. In the\n        case of `object`, we need to guess the datatype by looking at the\n        Python objects in this Series.\n\n        Be aware that Series of the `object` dtype don't carry enough\n        information to always lead to a meaningful Arrow type. In the case that\n        we cannot infer a type, e.g. because the DataFrame is of length 0 or\n        the Series only contains None/nan objects, the type is set to\n        null. This behavior can be avoided by constructing an explicit schema\n        and passing it to this function.\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        schema : pyarrow.Schema, optional\n            The expected schema of the Arrow Table. This can be used to\n            indicate the type of columns if we cannot infer it automatically.\n            If passed, the output will have exactly this schema. Columns\n            specified in the schema that are not found in the DataFrame columns\n            or its index will raise an error. Additional columns or index\n            levels in the DataFrame which are not specified in the schema will\n            be ignored.\n        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``Table``. The default of None will store the index as a column,\n            except for RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n        nthreads : int, default None (may use up to system CPU count threads)\n            If greater than 1, convert columns to Arrow in parallel using\n            indicated number of threads\n        columns : lis""t, optional\n           List of column to be converted. If None, use all columns.\n        safe : boolean, default True\n           Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        pyarrow.Table\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Table.from_pandas(df)\n        <pyarrow.lib.Table object at 0x7f05d1fb1b40>\n        ";
static const char __pyx_k_pyarrow_SparseTensorCOO_type_0[] = "<pyarrow.SparseTensorCOO>\ntype: {0.type}\nshape: {0.shape}";
static const char __pyx_k_pyarrow_SparseTensorCSR_type_0[] = "<pyarrow.SparseTensorCSR>\ntype: {0.type}\nshape: {0.shape}";
static const char __pyx_k_pyx_unpickle_SerializationCont[] = "__pyx_unpickle_SerializationContext";
static const char __pyx_k_pyx_unpickle__PandasConvertibl[] = "__pyx_unpickle__PandasConvertible";
static const char __pyx_k_Buffer_size_must_be_larger_than[] = "Buffer size must be larger than zero";
static const char __pyx_k_Calling_data_on_ChunkedArray_is[] = "Calling .data on ChunkedArray is provided for compatibility after Column was removed, simply drop this attribute";
static const char __pyx_k_Can_only_instantiate_subclasses[] = "Can only instantiate subclasses of ExtensionType";
static const char __pyx_k_Cannot_compare_scalars_that_don[] = "Cannot compare scalars that don't support as_py()";
static const char __pyx_k_Cannot_specify_a_mask_or_a_size[] = "Cannot specify a mask or a size when passing an object that is converted with the __arrow_array__ protocol.";
static const char __pyx_k_Cast_array_values_to_another_da[] = "\n        Cast array values to another data type.\n\n        Example\n        -------\n\n        >>> from datetime import datetime\n        >>> import pyarrow as pa\n        >>> arr = pa.array([datetime(2010, 1, 1), datetime(2015, 1, 1)])\n        >>> arr.type\n        TimestampType(timestamp[us])\n\n        You can use ``pyarrow.DataType`` objects to specify the target type:\n\n        >>> arr.cast(pa.timestamp('ms'))\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast(pa.timestamp('ms')).type\n        TimestampType(timestamp[ms])\n\n        Alternatively, it is also supported to use the string aliases for these\n        types:\n\n        >>> arr.cast('timestamp[ms]')\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast('timestamp[ms]').type\n        TimestampType(timestamp[ms])\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to cast to\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : Array\n        ";
static const char __pyx_k_ChunkedArray_data_type_was_NULL[] = "ChunkedArray data type was NULL";
static const char __pyx_k_Column_does_not_exist_in_schema[] = "Column {} does not exist in schema";
static const char __pyx_k_Create_pyarrow_Array_instance_f[] = "\n    Create pyarrow.Array instance from a Python object\n\n    Parameters\n    ----------\n    obj : sequence, iterable, ndarray or Series\n        If both type and size are specified may be a single use iterable. If\n        not strongly-typed, Arrow type will be inferred for resulting array\n    type : pyarrow.DataType\n        Explicit type to attempt to coerce to, otherwise will be inferred from\n        the data\n    mask : array (boolean), optional\n        Indicate which values are null (True) or not null (False).\n    size : int64, optional\n        Size of the elements. If the imput is larger than size bail at this\n        length. For iterators, if size is larger than the input iterator this\n        will be treated as a \"max size\", but will involve an initial allocation\n        of size followed by a resize to the actual size (so if you know the\n        exact size specifying it correctly will give you better performance).\n    from_pandas : boolean, default None\n        Use pandas's semantics for inferring nulls from values in\n        ndarray-like data. If passed, the mask tasks precendence, but\n        if a value is unmasked (not-null), but still null according to\n        pandas semantics, then it is null. Defaults to False if not\n        passed explicitly by user, or True if a pandas object is\n        passed in\n    safe : boolean, default True\n        Check for overflows or other unsafe conversions\n    memory_pool : pyarrow.MemoryPool, optional\n        If not passed, will allocate memory from the currently-set default\n        memory pool\n\n    Notes\n    -----\n    Localized timestamps will currently be returned as UTC (pandas's native\n    representation).  Timezone-naive data will be implicitly interpreted as\n    UTC.\n\n    Examples\n    --------\n    >>> import pandas as pd\n    >>> import pyarrow as pa\n    >>> pa.array(pd.Series([1, 2]))\n    <pyarrow.array.Int64Array object at 0x7f674e4c0e10>\n    [\n      1,\n      2\n    ]\n""\n    >>> import numpy as np\n    >>> pa.array(pd.Series([1, 2]), np.array([0, 1],\n    ... dtype=bool))\n    <pyarrow.array.Int64Array object at 0x7f9019e11208>\n    [\n      1,\n      null\n    ]\n\n    Returns\n    -------\n    array : pyarrow.Array or pyarrow.ChunkedArray (if object data\n    overflowed binary storage)\n    ";
static const char __pyx_k_Do_not_call_Field_s_constructor[] = "Do not call Field's constructor directly, use `pyarrow.field` instead.";
static const char __pyx_k_Do_not_call_Table_s_constructor[] = "Do not call Table's constructor directly, use one of the `Table.from_*` functions instead.";
static const char __pyx_k_Expected_storage_type_0_but_got[] = "Expected storage type {0} but got {1}";
static const char __pyx_k_File_object_is_malformed_has_no[] = "File object is malformed, has no mode";
static const char __pyx_k_Filter_the_array_with_a_boolean[] = "\n        Filter the array with a boolean mask.\n\n        Parameters\n        ----------\n        mask : Array\n            The boolean mask indicating which values to extract.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\"])\n        >>> mask = pa.array([True, False, None, False, True])\n        >>> arr.filter(mask)\n        <pyarrow.lib.StringArray object at 0x7fa826df9200>\n        [\n          \"a\",\n          null,\n          \"e\"\n        ]\n        ";
static const char __pyx_k_Incompatible_storage_type_0_for[] = "Incompatible storage type {0} for extension type {1}";
static const char __pyx_k_Invalid_value_for_compression_r[] = "Invalid value for compression: {!r}";
static const char __pyx_k_List_requires_DataType_or_Field[] = "List requires DataType or Field";
static const char __pyx_k_Metadata_must_be_an_instance_of[] = "Metadata must be an instance of dict";
static const char __pyx_k_Must_be_an_instance_of_datetime[] = "Must be an instance of `datetime.tzinfo`";
static const char __pyx_k_Must_pass_decompressed_size_for[] = "Must pass decompressed_size for {0} codec";
static const char __pyx_k_Returns_implied_schema_from_dat[] = "\n        Returns implied schema from dataframe\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        preserve_index : bool, default True\n            Whether to store the index as an additional column (or columns, for\n            MultiIndex) in the resulting `Table`.\n            The default of None will store the index as a column, except for\n            RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n\n        Returns\n        -------\n        pyarrow.Schema\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Schema.from_pandas(df)\n        int: int64\n        str: string\n        __index_level_0__: int64\n        ";
static const char __pyx_k_Take_elements_from_an_array_The[] = "\n        Take elements from an array.\n\n        The resulting array will be of the same type as the input array, with\n        elements taken from the input array at the given indices. If an index\n        is null then the taken element will be null.\n\n        Parameters\n        ----------\n        indices : Array\n            The indices of the values to extract. Array needs to be of\n            integer type.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\", \"f\"])\n        >>> indices = pa.array([0, None, 4, 3])\n        >>> arr.take(indices)\n        <pyarrow.lib.StringArray object at 0x7ffa4fc7d368>\n        [\n          \"a\",\n          null,\n          \"e\",\n          null\n        ]\n        ";
static const char __pyx_k_Target_schema_s_field_names_are[] = "Target schema's field names are not matching the table's field names: {!r}, {!r}";
static const char __pyx_k_The_names_argument_is_not_valid[] = "The 'names' argument is not valid when passing a dictionary";
static const char __pyx_k_We_do_not_know_how_to_serialize[] = "We do not know how to serialize the object '{}'";
static const char __pyx_k_datetime_conversion_functions_l[] = "_datetime_conversion_functions.<locals>.<lambda>";
static const char __pyx_k_mask_not_implemented_with_Arrow[] = "mask not implemented with Arrow array inputs yet";
static const char __pyx_k_not_registered_in_deserializati[] = " not registered in deserialization callback";
static const char __pyx_k_not_supported_for_buffer_protoc[] = " not supported for buffer protocol";
static const char __pyx_k_pyarrow_Message_type_0_metadata[] = "pyarrow.Message\ntype: {0}\nmetadata length: {1}\nbody length: {2}";
static const char __pyx_k_pyarrow_Tensor_type_0_type_shap[] = "<pyarrow.Tensor>\ntype: {0.type}\nshape: {0.shape}\nstrides: {0.strides}";
static const char __pyx_k_python_extension_types_registry[] = "_python_extension_types_registry";
static const char __pyx_k_self_ap_self_sp_array_cannot_be[] = "self.ap,self.sp_array cannot be converted to a Python object for pickling";
static const char __pyx_k_self_client_cannot_be_converted[] = "self.client cannot be converted to a Python object for pickling";
static const char __pyx_k_self_reader_cannot_be_converted[] = "self.reader cannot be converted to a Python object for pickling";
static const char __pyx_k_self_writer_cannot_be_converted[] = "self.writer cannot be converted to a Python object for pickling";
static const char __pyx_k_Arrays_were_not_all_the_same_len[] = "Arrays were not all the same length: {0} vs {1}";
static const char __pyx_k_CPU_count_must_be_strictly_posit[] = "CPU count must be strictly positive";
static const char __pyx_k_Cannot_compare_Arrow_values_that[] = "Cannot compare Arrow values that don't support as_py()";
static const char __pyx_k_Cannot_construct_a_chunked_array[] = "Cannot construct a chunked array with neither arrays nor type";
static const char __pyx_k_Cannot_convert_nanosecond_timest[] = "Cannot convert nanosecond timestamps without pandas";
static const char __pyx_k_Cannot_create_multiple_NAType_in[] = "Cannot create multiple NAType instances";
static const char __pyx_k_Cannot_pass_a_numpy_masked_array[] = "Cannot pass a numpy masked array and specify a mask at the same time";
static const char __pyx_k_Cannot_pass_both_schema_and_meta[] = "Cannot pass both schema and metadata";
static const char __pyx_k_Cannot_pass_both_schema_and_name[] = "Cannot pass both schema and names";
static const char __pyx_k_Comparisons_with_pyarrow_Array_a[] = "Comparisons with pyarrow.Array are not implemented";
static const char __pyx_k_DeserializationCallbackError___i[] = "DeserializationCallbackError.__init__";
static const char __pyx_k_Do_not_call_Buffer_s_constructor[] = "Do not call Buffer's constructor directly, use `pyarrow.py_buffer` function instead.";
static const char __pyx_k_Do_not_call_ChunkedArray_s_const[] = "Do not call ChunkedArray's constructor directly, use `chunked_array` function instead.";
static const char __pyx_k_Do_not_call_RecordBatch_s_constr[] = "Do not call RecordBatch's constructor directly, use one of the `RecordBatch.from_*` functions instead.";
static const char __pyx_k_Do_not_call_Schema_s_constructor[] = "Do not call Schema's constructor directly, use `pyarrow.schema` instead.";
static const char __pyx_k_Do_not_call_SparseTensorCOO_s_co[] = "Do not call SparseTensorCOO's constructor directly, use one of the `pyarrow.SparseTensorCOO.from_*` functions instead.";
static const char __pyx_k_Do_not_call_SparseTensorCSR_s_co[] = "Do not call SparseTensorCSR's constructor directly, use one of the `pyarrow.SparseTensorCSR.from_*` functions instead.";
static const char __pyx_k_Do_not_call_Tensor_s_constructor[] = "Do not call Tensor's constructor directly, use one of the `pyarrow.Tensor.from_*` functions instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct[] = "Do not call {}'s constructor directly, use pyarrow.*_memory_pool instead.";
static const char __pyx_k_Expected_1_dimensional_array_for[] = "Expected 1-dimensional array for SparseTensorCSR indptr";
static const char __pyx_k_Expected_2_dimensional_array_for[] = "Expected 2-dimensional array for SparseTensorCOO indices";
static const char __pyx_k_Expected_integer_or_string_index[] = "Expected integer or string index";
static const char __pyx_k_Expected_pandas_DataFrame_or_pyt[] = "Expected pandas DataFrame or python dictionary";
static const char __pyx_k_HDFS_client_improperly_initializ[] = "HDFS client improperly initialized";
static const char __pyx_k_Incompatible_checksums_s_vs_0x59[] = "Incompatible checksums (%s vs 0x599dcce = (type))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x9a[] = "Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())";
static const char __pyx_k_Incompatible_checksums_s_vs_0xf9[] = "Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))";
static const char __pyx_k_Index_must_either_be_string_or_i[] = "Index must either be string or integer";
static const char __pyx_k_Length_of_names_does_not_match_l[] = "Length of names ({}) does not match length of arrays ({})";
static const char __pyx_k_Mode_must_be_rb_read_wb_write_ne[] = "Mode must be 'rb' (read), 'wb' (write, new file), or 'ab' (append)";
static const char __pyx_k_Must_pass_either_names_or_fields[] = "Must pass either names or fields";
static const char __pyx_k_Must_pass_names_or_schema_to_Tab[] = "Must pass names or schema to Table.from_arrays";
static const char __pyx_k_Must_pass_schema_or_at_least_one[] = "Must pass schema, or at least one RecordBatch";
static const char __pyx_k_Nanosecond_timestamp_is_not_safe[] = "Nanosecond timestamp {} is not safely convertible  to microseconds to convert to datetime.datetime. Install pandas to return as Timestamp with  nanosecond support or access the .value attribute.";
static const char __pyx_k_NumPy_array_view_is_only_support[] = "NumPy array view is only supported for arrays without nulls.";
static const char __pyx_k_Offset_must_represent_whole_numb[] = "Offset must represent whole number of minutes";
static const char __pyx_k_Only_extension_types_can_be_regi[] = "Only extension types can be registered";
static const char __pyx_k_Please_use_read_next_batch_inste[] = "Please use read_next_batch instead of get_next_batch";
static const char __pyx_k_Schema_and_number_of_arrays_uneq[] = "Schema and number of arrays unequal";
static const char __pyx_k_Schema_field_name_corresponds_to[] = "Schema field name corresponds to more than one field";
static const char __pyx_k_Schema_passed_to_names_option_pl[] = "Schema passed to names= option, please pass schema= explicitly. Will raise exception in future";
static const char __pyx_k_SerializationCallbackError___ini[] = "SerializationCallbackError.__init__";
static const char __pyx_k_StringBuilder_only_accepts_strin[] = "StringBuilder only accepts string objects";
static const char __pyx_k_Struct_field_name_corresponds_to[] = "Struct field name corresponds to more than one field";
static const char __pyx_k_The_add_metadata_method_is_depre[] = "The 'add_metadata' method is deprecated, use 'with_metadata' instead";
static const char __pyx_k_The_dictionary_index_type_should[] = "The dictionary index type should be signed integer.";
static const char __pyx_k_The_field_by_name_method_is_depr[] = "The 'field_by_name' method is deprecated, use 'field' instead";
static const char __pyx_k_The_names_and_metadata_arguments[] = "The 'names' and 'metadata' arguments are not valid when passing a pandas DataFrame";
static const char __pyx_k_The_object_s___arrow_array___met[] = "The object's __arrow_array__ method does not return a pyarrow Array.";
static const char __pyx_k_The_parameter_chunksize_is_depre[] = "The parameter chunksize is deprecated for pyarrow.Table.to_batches as of 0.15, please use the parameter max_chunksize instead";
static const char __pyx_k_The_type_id_argument_must_be_a_s[] = "The type_id argument must be a string. The value passed in has type {}.";
static const char __pyx_k_Type_s_expected_number_of_buffer[] = "Type's expected number of buffers ({0}) did not match the passed number ({1}).";
static const char __pyx_k_Type_s_expected_number_of_childr[] = "Type's expected number of children ({0}) did not match the passed number ({1}).";
static const char __pyx_k_Unable_to_convert_timezone_to_st[] = "Unable to convert timezone `{}` to string";
static const char __pyx_k_Unable_to_read_from_object_of_ty[] = "Unable to read from object of type: {0}";
static const char __pyx_k_Unable_to_read_message_from_obje[] = "Unable to read message from object with type: {0}";
static const char __pyx_k_Unable_to_wrap_Datum_in_a_Python[] = "Unable to wrap Datum in a Python object";
static const char __pyx_k_Writable_buffer_requested_but_Ar[] = "Writable buffer requested but Arrow buffer was not mutable";
static const char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment";
static const char __pyx_k_binary_file_expected_got_text_fi[] = "binary file expected, got text file";
static const char __pyx_k_could_not_infer_open_mode_for_fi[] = "could not infer open mode for file-like object ";
static const char __pyx_k_field_or_tuple_expected_got_None[] = "field or tuple expected, got None";
static const char __pyx_k_key_must_either_be_a_slice_or_in[] = "key must either be a slice or integer";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_only_slices_with_step_1_supporte[] = "only slices with step 1 supported";
static const char __pyx_k_pa_input_stream_called_with_inst[] = "pa.input_stream() called with instance of '{}'";
static const char __pyx_k_pa_output_stream_called_with_ins[] = "pa.output_stream() called with instance of '{}'";
static const char __pyx_k_precision_should_be_between_1_an[] = "precision should be between 1 and 38";
static const char __pyx_k_prior_column_had_a_different_num[] = "prior column had a different number of rows";
static const char __pyx_k_pyarrow_does_not_know_how_to_ser[] = "pyarrow does not know how to serialize objects of type {}.";
static const char __pyx_k_register_default_serialization_h[] = "register_default_serialization_handlers";
static const char __pyx_k_self_data_cannot_be_converted_to[] = "self.data cannot be converted to a Python object for pickling";
static const char __pyx_k_self_logging_pool_self_pool_cann[] = "self.logging_pool,self.pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_pool_cannot_be_converted_to[] = "self.pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_pool_self_proxy_pool_cannot[] = "self.pool,self.proxy_pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_array_cannot_be_converte[] = "self.sp_array cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_scalar_cannot_be_convert[] = "self.sp_scalar cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_sparse_tensor_self_stp_c[] = "self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_tensor_self_tp_cannot_be[] = "self.sp_tensor,self.tp cannot be converted to a Python object for pickling";
static const char __pyx_k_trying_to_write_an_immutable_buf[] = "trying to write an immutable buffer";
static const char __pyx_k_tzinfo_to_string_locals_fixed_of[] = "tzinfo_to_string.<locals>.fixed_offset_to_string";
static const char __pyx_k_Can_only_instantiate_subclasses_2[] = "Can only instantiate subclasses of PyExtensionType";
static const char __pyx_k_Do_not_call_s_constructor_direct_2[] = "Do not call {}'s constructor directly, use pyarrow.logging_memory_pool instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_3[] = "Do not call {}'s constructor directly, use pyarrow.proxy_memory_pool instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_4[] = "Do not call {}'s constructor directly, use public functions like pyarrow.int64, pyarrow.list_, etc. instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_5[] = "Do not call {}'s constructor directly, use array subscription instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_6[] = "Do not call {}'s constructor directly.";
static const char __pyx_k_Do_not_call_s_constructor_direct_7[] = "Do not call {}'s constructor directly, use one of the `pyarrow.Array.from_*` functions instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_8[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.read_message` function instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_9[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.MessageReader.open_stream` function instead.";
static const char __pyx_k_Expected_1_dimensional_array_for_2[] = "Expected 1-dimensional array for SparseTensorCSR indices";
static const char __pyx_k_Must_pass_either_names_or_fields_2[] = "Must pass either names or fields, not both";
static const char __pyx_k_NumPy_array_view_is_only_support_2[] = "NumPy array view is only supported for primitive types.";
static const char __pyx_k_The_parameter_chunksize_is_depre_2[] = "The parameter chunksize is deprecated for the write_table methods as of 0.15, please use parameter max_chunksize instead";
static PyObject *__pyx_kp_u_02d_02d;
static PyObject *__pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9;
static PyObject *__pyx_kp_u_0_1;
static PyObject *__pyx_kp_u_0_19_0;
static PyObject *__pyx_kp_u_0_20_0;
static PyObject *__pyx_kp_u_0_23_0;
static PyObject *__pyx_kp_u_0_25;
static PyObject *__pyx_kp_u_0___class_____name___0;
static PyObject *__pyx_n_s_Array;
static PyObject *__pyx_n_s_ArrayValue;
static PyObject *__pyx_n_s_Array___iter;
static PyObject *__pyx_kp_u_Array_cast_line_517;
static PyObject *__pyx_kp_u_Array_data_type_was_NULL;
static PyObject *__pyx_kp_u_Array_filter_line_860;
static PyObject *__pyx_kp_u_Array_take_line_817;
static PyObject *__pyx_kp_u_Array_was_NULL;
static PyObject *__pyx_kp_u_Arrays_were_not_all_the_same_len;
static PyObject *__pyx_n_s_ArrowCapacityError;
static PyObject *__pyx_n_s_ArrowException;
static PyObject *__pyx_n_s_ArrowIOError;
static PyObject *__pyx_n_s_ArrowIndexError;
static PyObject *__pyx_n_s_ArrowInvalid;
static PyObject *__pyx_n_s_ArrowKeyError;
static PyObject *__pyx_n_s_ArrowKeyError___str;
static PyObject *__pyx_n_s_ArrowMemoryError;
static PyObject *__pyx_n_s_ArrowNotImplementedError;
static PyObject *__pyx_n_s_ArrowSerializationError;
static PyObject *__pyx_n_s_ArrowTypeError;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_b_B;
static PyObject *__pyx_n_s_BaseExtensionType;
static PyObject *__pyx_n_s_BaseTzInfo;
static PyObject *__pyx_kp_u_Batch_number_0_out_of_range;
static PyObject *__pyx_n_s_BinaryArray;
static PyObject *__pyx_n_s_BinaryValue;
static PyObject *__pyx_n_s_BooleanArray;
static PyObject *__pyx_n_s_BooleanValue;
static PyObject *__pyx_n_s_Buffer;
static PyObject *__pyx_n_s_BufferError;
static PyObject *__pyx_n_s_BufferOutputStream;
static PyObject *__pyx_n_s_BufferReader;
static PyObject *__pyx_kp_u_Buffer_size_must_be_larger_than;
static PyObject *__pyx_n_s_BufferedIOBase;
static PyObject *__pyx_n_s_BufferedInputStream;
static PyObject *__pyx_n_s_BufferedOutputStream;
static PyObject *__pyx_kp_u_CPU_count_must_be_strictly_posit;
static PyObject *__pyx_n_s_CRecordBatchReader;
static PyObject *__pyx_n_s_CRecordBatchReader___iter;
static PyObject *__pyx_n_s_CRecordBatchWriter;
static PyObject *__pyx_kp_u_Calling_data_on_ChunkedArray_is;
static PyObject *__pyx_kp_u_Can_only_instantiate_subclasses;
static PyObject *__pyx_kp_u_Can_only_instantiate_subclasses_2;
static PyObject *__pyx_kp_u_Cannot_compare_Arrow_values_that;
static PyObject *__pyx_kp_u_Cannot_compare_scalars_that_don;
static PyObject *__pyx_kp_u_Cannot_construct_a_chunked_array;
static PyObject *__pyx_kp_u_Cannot_convert_nanosecond_timest;
static PyObject *__pyx_kp_u_Cannot_create_multiple_NAType_in;
static PyObject *__pyx_kp_u_Cannot_pass_a_numpy_masked_array;
static PyObject *__pyx_kp_u_Cannot_pass_both_schema_and_meta;
static PyObject *__pyx_kp_u_Cannot_pass_both_schema_and_name;
static PyObject *__pyx_kp_u_Cannot_specify_a_mask_or_a_size;
static PyObject *__pyx_kp_u_Cast_array_values_to_another_da;
static PyObject *__pyx_n_s_Categorical;
static PyObject *__pyx_kp_u_Chunk_index_out_of_range;
static PyObject *__pyx_n_s_ChunkedArray;
static PyObject *__pyx_n_s_ChunkedArray___iter;
static PyObject *__pyx_kp_u_ChunkedArray_data_type_was_NULL;
static PyObject *__pyx_n_s_ChunkedArray_iterchunks;
static PyObject *__pyx_kp_u_ChunkedArray_was_NULL;
static PyObject *__pyx_kp_u_Column_does_not_exist_in_schema;
static PyObject *__pyx_kp_u_Column_does_not_exist_in_table;
static PyObject *__pyx_kp_u_Column_r_not_found;
static PyObject *__pyx_kp_u_Comparisons_with_pyarrow_Array_a;
static PyObject *__pyx_n_s_CompressedInputStream;
static PyObject *__pyx_n_s_CompressedOutputStream;
static PyObject *__pyx_kp_u_Convert_pandas_DataFrame_to_an;
static PyObject *__pyx_kp_u_Create_pyarrow_Array_instance_f;
static PyObject *__pyx_n_s_DEFAULT_BUFFER_SIZE;
static PyObject *__pyx_n_s_DataFrame;
static PyObject *__pyx_n_s_DataType;
static PyObject *__pyx_kp_u_DataType_expected_got_r;
static PyObject *__pyx_n_s_Date32Array;
static PyObject *__pyx_n_s_Date32Value;
static PyObject *__pyx_n_s_Date64Array;
static PyObject *__pyx_n_s_Date64Value;
static PyObject *__pyx_n_s_DatetimeTZDtype;
static PyObject *__pyx_n_s_Decimal;
static PyObject *__pyx_n_s_Decimal128Array;
static PyObject *__pyx_n_s_Decimal128Type;
static PyObject *__pyx_n_s_DecimalValue;
static PyObject *__pyx_n_s_DeserializationCallbackError;
static PyObject *__pyx_n_s_DeserializationCallbackError___i;
static PyObject *__pyx_n_s_DictionaryArray;
static PyObject *__pyx_n_s_DictionaryMemo;
static PyObject *__pyx_n_s_DictionaryType;
static PyObject *__pyx_n_s_DictionaryValue;
static PyObject *__pyx_kp_u_Do_not_call_Buffer_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_ChunkedArray_s_const;
static PyObject *__pyx_kp_u_Do_not_call_Field_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_RecordBatch_s_constr;
static PyObject *__pyx_kp_u_Do_not_call_Schema_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_SparseTensorCOO_s_co;
static PyObject *__pyx_kp_u_Do_not_call_SparseTensorCSR_s_co;
static PyObject *__pyx_kp_u_Do_not_call_Table_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_Tensor_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_2;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_3;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_4;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_5;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_6;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_7;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_8;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_9;
static PyObject *__pyx_n_s_DoubleArray;
static PyObject *__pyx_n_s_DoubleScalar;
static PyObject *__pyx_n_s_DoubleValue;
static PyObject *__pyx_n_s_EOFError;
static PyObject *__pyx_n_s_Empty;
static PyObject *__pyx_kp_u_End_of_Arrow_stream;
static PyObject *__pyx_kp_u_Expected_1_dimensional_array_for;
static PyObject *__pyx_kp_u_Expected_1_dimensional_array_for_2;
static PyObject *__pyx_kp_u_Expected_2_dimensional_array_for;
static PyObject *__pyx_kp_u_Expected_integer_or_string_index;
static PyObject *__pyx_kp_u_Expected_pandas_DataFrame_or_pyt;
static PyObject *__pyx_kp_u_Expected_storage_type_0_but_got;
static PyObject *__pyx_n_s_ExtensionArray;
static PyObject *__pyx_n_s_ExtensionRegistryNanny;
static PyObject *__pyx_n_s_ExtensionType;
static PyObject *__pyx_n_u_F;
static PyObject *__pyx_n_s_FIXED_OFFSET_RE;
static PyObject *__pyx_kp_u_Failed_to_allocate_0_bytes;
static PyObject *__pyx_n_s_FeatherError;
static PyObject *__pyx_n_s_FeatherReader;
static PyObject *__pyx_n_s_FeatherWriter;
static PyObject *__pyx_n_s_Field;
static PyObject *__pyx_kp_u_File_object_is_malformed_has_no;
static PyObject *__pyx_kp_u_Filter_the_array_with_a_boolean;
static PyObject *__pyx_n_s_FixedOffset;
static PyObject *__pyx_n_s_FixedOffset_2;
static PyObject *__pyx_n_s_FixedSizeBinaryArray;
static PyObject *__pyx_n_s_FixedSizeBinaryType;
static PyObject *__pyx_n_s_FixedSizeBinaryValue;
static PyObject *__pyx_n_s_FixedSizeBufferWriter;
static PyObject *__pyx_n_s_FloatArray;
static PyObject *__pyx_n_s_FloatScalar;
static PyObject *__pyx_n_s_FloatValue;
static PyObject *__pyx_n_s_FloatingPointArray;
static PyObject *__pyx_n_s_Full;
static PyObject *__pyx_n_s_FunctionContext;
static PyObject *__pyx_n_s_FutureWarning;
static PyObject *__pyx_n_b_H;
static PyObject *__pyx_n_s_HDFS_PATH_RE;
static PyObject *__pyx_kp_u_HDFS_client_improperly_initializ;
static PyObject *__pyx_kp_u_HDFS_client_is_closed;
static PyObject *__pyx_n_s_HadoopFileSystem;
static PyObject *__pyx_n_s_HalfFloatArray;
static PyObject *__pyx_n_s_HalfFloatValue;
static PyObject *__pyx_n_s_HdfsFile;
static PyObject *__pyx_n_s_HdfsFileNanny;
static PyObject *__pyx_n_b_I;
static PyObject *__pyx_n_s_IOBase;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_kp_u_I_O_operation_on_closed_file;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x59;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9a;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xf9;
static PyObject *__pyx_kp_u_Incompatible_storage_type_0_for;
static PyObject *__pyx_n_s_Index;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_u_Index_must_either_be_string_or_i;
static PyObject *__pyx_kp_u_Indices_must_be_integer_type;
static PyObject *__pyx_n_s_Int16Array;
static PyObject *__pyx_n_s_Int16Scalar;
static PyObject *__pyx_n_s_Int16Value;
static PyObject *__pyx_n_s_Int32Array;
static PyObject *__pyx_n_s_Int32Scalar;
static PyObject *__pyx_n_s_Int32Value;
static PyObject *__pyx_n_s_Int64Array;
static PyObject *__pyx_n_s_Int64Scalar;
static PyObject *__pyx_n_s_Int64Value;
static PyObject *__pyx_n_s_Int8Array;
static PyObject *__pyx_n_s_Int8Scalar;
static PyObject *__pyx_n_s_Int8Value;
static PyObject *__pyx_n_s_IntegerArray;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_for_time32;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_for_time64;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_string;
static PyObject *__pyx_kp_u_Invalid_file_mode_0;
static PyObject *__pyx_kp_u_Invalid_union_mode_0_r;
static PyObject *__pyx_kp_u_Invalid_value_for_compression_r;
static PyObject *__pyx_kp_u_Invalid_value_of_whence_0;
static PyObject *__pyx_n_s_K;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_LargeBinaryArray;
static PyObject *__pyx_n_s_LargeBinaryValue;
static PyObject *__pyx_n_s_LargeListArray;
static PyObject *__pyx_n_s_LargeListType;
static PyObject *__pyx_n_s_LargeListValue;
static PyObject *__pyx_n_s_LargeListValue___iter;
static PyObject *__pyx_n_s_LargeStringArray;
static PyObject *__pyx_n_s_LargeStringValue;
static PyObject *__pyx_kp_u_Length_of_names_does_not_match_l;
static PyObject *__pyx_n_s_ListArray;
static PyObject *__pyx_n_s_ListType;
static PyObject *__pyx_n_s_ListValue;
static PyObject *__pyx_n_s_ListValue___iter;
static PyObject *__pyx_kp_u_List_requires_DataType_or_Field;
static PyObject *__pyx_n_s_LoggingMemoryPool;
static PyObject *__pyx_n_s_LooseVersion;
static PyObject *__pyx_n_s_Mapping;
static PyObject *__pyx_n_s_MaskedArray;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_n_s_MemoryMappedFile;
static PyObject *__pyx_n_s_MemoryPool;
static PyObject *__pyx_n_s_Message;
static PyObject *__pyx_n_s_MessageReader;
static PyObject *__pyx_n_s_MessageReader___iter;
static PyObject *__pyx_kp_u_Metadata_must_be_an_instance_of;
static PyObject *__pyx_n_s_MockOutputStream;
static PyObject *__pyx_kp_u_Mode_must_be_rb_read_wb_write_ne;
static PyObject *__pyx_kp_u_Must_be_an_instance_of_datetime;
static PyObject *__pyx_kp_u_Must_pass_decompressed_size_for;
static PyObject *__pyx_kp_u_Must_pass_either_names_or_fields;
static PyObject *__pyx_kp_u_Must_pass_either_names_or_fields_2;
static PyObject *__pyx_kp_u_Must_pass_names_or_schema_to_Tab;
static PyObject *__pyx_kp_u_Must_pass_schema_or_at_least_one;
static PyObject *__pyx_n_s_NA;
static PyObject *__pyx_n_s_NAType;
static PyObject *__pyx_n_u_NULL;
static PyObject *__pyx_n_s_NULL_2;
static PyObject *__pyx_kp_u_Nanosecond_timestamp_is_not_safe;
static PyObject *__pyx_n_s_NativeFile;
static PyObject *__pyx_kp_u_No_type_alias_for_0;
static PyObject *__pyx_kp_u_Non_fixed_width_type;
static PyObject *__pyx_n_u_None;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_NullArray;
static PyObject *__pyx_n_s_NullType;
static PyObject *__pyx_kp_u_NumPy_array_view_is_only_support;
static PyObject *__pyx_kp_u_NumPy_array_view_is_only_support_2;
static PyObject *__pyx_n_s_NumericArray;
static PyObject *__pyx_n_s_OSFile;
static PyObject *__pyx_kp_u_Offset_must_be_non_negative;
static PyObject *__pyx_kp_u_Offset_must_represent_whole_numb;
static PyObject *__pyx_kp_u_Only_extension_types_can_be_regi;
static PyObject *__pyx_n_s_PY3;
static PyObject *__pyx_n_s_PandasAPIShim;
static PyObject *__pyx_n_s_PandasConvertible;
static PyObject *__pyx_n_s_PickleBuffer;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_u_Please_implement_0___reduce;
static PyObject *__pyx_kp_u_Please_use_read_next_batch_inste;
static PyObject *__pyx_n_s_ProxyMemoryPool;
static PyObject *__pyx_n_s_PyExtensionType;
static PyObject *__pyx_n_s_PythonFile;
static PyObject *__pyx_n_b_Q;
static PyObject *__pyx_n_s_Queue;
static PyObject *__pyx_n_s_QueueEmpty;
static PyObject *__pyx_n_s_QueueFull;
static PyObject *__pyx_n_s_RecordBatch;
static PyObject *__pyx_n_s_RecordBatchFileReader;
static PyObject *__pyx_n_s_RecordBatchFileWriter;
static PyObject *__pyx_n_s_RecordBatchStreamReader;
static PyObject *__pyx_n_s_RecordBatchStreamWriter;
static PyObject *__pyx_n_s_ResizableBuffer;
static PyObject *__pyx_kp_u_Returns_implied_schema_from_dat;
static PyObject *__pyx_n_s_Scalar;
static PyObject *__pyx_n_s_ScalarValue;
static PyObject *__pyx_kp_u_Scalar_data_type_was_NULL;
static PyObject *__pyx_kp_u_Scalar_was_NULL;
static PyObject *__pyx_n_s_Schema;
static PyObject *__pyx_n_s_Schema___iter;
static PyObject *__pyx_kp_u_Schema_and_number_of_arrays_uneq;
static PyObject *__pyx_kp_u_Schema_field_name_corresponds_to;
static PyObject *__pyx_kp_u_Schema_from_pandas_line_963;
static PyObject *__pyx_kp_u_Schema_passed_to_names_option_pl;
static PyObject *__pyx_n_s_SerializationCallbackError;
static PyObject *__pyx_n_s_SerializationCallbackError___ini;
static PyObject *__pyx_n_s_SerializationContext;
static PyObject *__pyx_n_s_SerializedPyObject;
static PyObject *__pyx_n_s_Series;
static PyObject *__pyx_n_s_SparseTensorCOO;
static PyObject *__pyx_kp_u_SparseTensorCOO_was_NULL;
static PyObject *__pyx_n_s_SparseTensorCSR;
static PyObject *__pyx_kp_u_SparseTensorCSR_was_NULL;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_s_StringArray;
static PyObject *__pyx_n_s_StringBuilder;
static PyObject *__pyx_kp_u_StringBuilder_only_accepts_strin;
static PyObject *__pyx_n_s_StringValue;
static PyObject *__pyx_n_s_StructArray;
static PyObject *__pyx_n_s_StructType;
static PyObject *__pyx_n_s_StructType___iter;
static PyObject *__pyx_n_s_StructValue;
static PyObject *__pyx_kp_u_Struct_field_name_corresponds_to;
static PyObject *__pyx_n_s_SystemError;
static PyObject *__pyx_n_s_Table;
static PyObject *__pyx_kp_u_Table_from_pandas_line_998;
static PyObject *__pyx_n_s_Table_itercolumns;
static PyObject *__pyx_kp_u_Take_elements_from_an_array_The;
static PyObject *__pyx_kp_u_Target_schema_s_field_names_are;
static PyObject *__pyx_n_s_Tensor;
static PyObject *__pyx_kp_u_Tensor_was_NULL;
static PyObject *__pyx_n_s_TextIOBase;
static PyObject *__pyx_kp_u_The_add_metadata_method_is_depre;
static PyObject *__pyx_kp_u_The_dictionary_index_type_should;
static PyObject *__pyx_kp_u_The_field_by_name_method_is_depr;
static PyObject *__pyx_kp_u_The_names_and_metadata_arguments;
static PyObject *__pyx_kp_u_The_names_argument_is_not_valid;
static PyObject *__pyx_kp_u_The_object_s___arrow_array___met;
static PyObject *__pyx_kp_u_The_parameter_chunksize_is_depre;
static PyObject *__pyx_kp_u_The_parameter_chunksize_is_depre_2;
static PyObject *__pyx_kp_u_The_type_id_argument_must_be_a_s;
static PyObject *__pyx_n_s_Thread;
static PyObject *__pyx_n_s_Time32Array;
static PyObject *__pyx_n_s_Time32Type;
static PyObject *__pyx_n_s_Time32Value;
static PyObject *__pyx_n_s_Time64Array;
static PyObject *__pyx_n_s_Time64Type;
static PyObject *__pyx_n_s_Time64Value;
static PyObject *__pyx_n_s_Timestamp;
static PyObject *__pyx_n_s_TimestampArray;
static PyObject *__pyx_n_s_TimestampType;
static PyObject *__pyx_n_s_TimestampValue;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_Type_BINARY;
static PyObject *__pyx_n_s_Type_BOOL;
static PyObject *__pyx_n_s_Type_DATE32;
static PyObject *__pyx_n_s_Type_DATE64;
static PyObject *__pyx_n_s_Type_DECIMAL;
static PyObject *__pyx_n_s_Type_DICTIONARY;
static PyObject *__pyx_n_s_Type_DOUBLE;
static PyObject *__pyx_n_s_Type_FIXED_SIZE_BINARY;
static PyObject *__pyx_n_s_Type_FLOAT;
static PyObject *__pyx_n_s_Type_HALF_FLOAT;
static PyObject *__pyx_kp_u_Type_ID;
static PyObject *__pyx_n_s_Type_INT16;
static PyObject *__pyx_n_s_Type_INT32;
static PyObject *__pyx_n_s_Type_INT64;
static PyObject *__pyx_n_s_Type_INT8;
static PyObject *__pyx_n_s_Type_LARGE_BINARY;
static PyObject *__pyx_n_s_Type_LARGE_LIST;
static PyObject *__pyx_n_s_Type_LARGE_STRING;
static PyObject *__pyx_n_s_Type_LIST;
static PyObject *__pyx_n_s_Type_MAP;
static PyObject *__pyx_n_s_Type_NA;
static PyObject *__pyx_n_s_Type_STRING;
static PyObject *__pyx_n_s_Type_STRUCT;
static PyObject *__pyx_n_s_Type_TIME32;
static PyObject *__pyx_n_s_Type_TIME64;
static PyObject *__pyx_n_s_Type_TIMESTAMP;
static PyObject *__pyx_n_s_Type_UINT16;
static PyObject *__pyx_n_s_Type_UINT32;
static PyObject *__pyx_n_s_Type_UINT64;
static PyObject *__pyx_n_s_Type_UINT8;
static PyObject *__pyx_n_s_Type_UNION;
static PyObject *__pyx_kp_u_Type_s_expected_number_of_buffer;
static PyObject *__pyx_kp_u_Type_s_expected_number_of_childr;
static PyObject *__pyx_n_s_UInt16Array;
static PyObject *__pyx_n_s_UInt16Scalar;
static PyObject *__pyx_n_s_UInt16Value;
static PyObject *__pyx_n_s_UInt32Array;
static PyObject *__pyx_n_s_UInt32Scalar;
static PyObject *__pyx_n_s_UInt32Value;
static PyObject *__pyx_n_s_UInt64Array;
static PyObject *__pyx_n_s_UInt64Scalar;
static PyObject *__pyx_n_s_UInt64Value;
static PyObject *__pyx_n_s_UInt8Array;
static PyObject *__pyx_n_s_UInt8Scalar;
static PyObject *__pyx_n_s_UInt8Value;
static PyObject *__pyx_kp_u_Unable_to_convert_timezone_to_st;
static PyObject *__pyx_kp_u_Unable_to_read_from_object_of_ty;
static PyObject *__pyx_kp_u_Unable_to_read_message_from_obje;
static PyObject *__pyx_kp_u_Unable_to_wrap_Datum_in_a_Python;
static PyObject *__pyx_n_s_UnionArray;
static PyObject *__pyx_n_s_UnionMode_DENSE;
static PyObject *__pyx_n_s_UnionMode_SPARSE;
static PyObject *__pyx_n_s_UnionType;
static PyObject *__pyx_n_s_UnionType___iter;
static PyObject *__pyx_n_s_UnionValue;
static PyObject *__pyx_n_s_UnknownExtensionType;
static PyObject *__pyx_kp_u_Unrecognized_compression_type;
static PyObject *__pyx_n_s_UnsupportedOperation;
static PyObject *__pyx_n_s_UserWarning;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u_We_do_not_know_how_to_serialize;
static PyObject *__pyx_kp_u_Writable_buffer_requested_but_Ar;
static PyObject *__pyx_kp_b__10;
static PyObject *__pyx_kp_b__181;
static PyObject *__pyx_n_s__2;
static PyObject *__pyx_kp_u__27;
static PyObject *__pyx_kp_u__28;
static PyObject *__pyx_n_u__3;
static PyObject *__pyx_n_u_ab;
static PyObject *__pyx_kp_u_accessing_non_existent_buffer_se;
static PyObject *__pyx_n_s_ad;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_column;
static PyObject *__pyx_n_s_address;
static PyObject *__pyx_n_s_alias;
static PyObject *__pyx_n_s_alignment;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_api;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arg_dict_memo;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arr;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_array_data;
static PyObject *__pyx_kp_u_array_line_99;
static PyObject *__pyx_n_s_arrays;
static PyObject *__pyx_n_s_arrow_array;
static PyObject *__pyx_n_u_arrow_array;
static PyObject *__pyx_n_s_arrow_ext_deserialize;
static PyObject *__pyx_n_s_arrow_obj;
static PyObject *__pyx_kp_u_arrow_py_extension_type;
static PyObject *__pyx_n_s_as_buffer;
static PyObject *__pyx_n_s_as_py;
static PyObject *__pyx_n_u_as_py;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_asbytes;
static PyObject *__pyx_n_s_assert_frame_equal;
static PyObject *__pyx_n_s_assert_open;
static PyObject *__pyx_n_s_assert_readable;
static PyObject *__pyx_n_s_assert_seekable;
static PyObject *__pyx_n_s_assert_writable;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_s_atexit;
static PyObject *__pyx_n_b_b;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_b_bBhHiIqQ;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_batch;
static PyObject *__pyx_n_s_batches;
static PyObject *__pyx_n_s_benchmark_PandasObjectIsNull;
static PyObject *__pyx_n_s_bg_write;
static PyObject *__pyx_n_s_binary;
static PyObject *__pyx_n_u_binary;
static PyObject *__pyx_kp_u_binary_file_expected_got_text_fi;
static PyObject *__pyx_n_s_binary_type;
static PyObject *__pyx_n_s_bit_width;
static PyObject *__pyx_n_u_block_size;
static PyObject *__pyx_n_s_body;
static PyObject *__pyx_n_s_body_length;
static PyObject *__pyx_n_s_bool;
static PyObject *__pyx_n_u_bool_2;
static PyObject *__pyx_n_u_boolean;
static PyObject *__pyx_n_u_brotli;
static PyObject *__pyx_n_s_buf;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_buffer_size;
static PyObject *__pyx_n_s_buffers;
static PyObject *__pyx_n_s_builtin_pickle;
static PyObject *__pyx_n_s_byte_width;
static PyObject *__pyx_n_u_bz2;
static PyObject *__pyx_kp_u_bz2_2;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_c_addr;
static PyObject *__pyx_n_s_c_array;
static PyObject *__pyx_n_s_c_arrays;
static PyObject *__pyx_n_s_c_batches;
static PyObject *__pyx_n_s_c_buf;
static PyObject *__pyx_n_s_c_buffers;
static PyObject *__pyx_n_s_c_child_data;
static PyObject *__pyx_n_s_c_codec;
static PyObject *__pyx_n_s_c_dim_names;
static PyObject *__pyx_n_s_c_extension_name;
static PyObject *__pyx_n_s_c_field_names;
static PyObject *__pyx_n_s_c_fields;
static PyObject *__pyx_n_s_c_from_pandas;
static PyObject *__pyx_n_s_c_meta;
static PyObject *__pyx_n_s_c_names;
static PyObject *__pyx_n_s_c_options;
static PyObject *__pyx_n_s_c_ordered;
static PyObject *__pyx_n_s_c_path;
static PyObject *__pyx_n_s_c_result;
static PyObject *__pyx_n_s_c_schema;
static PyObject *__pyx_n_s_c_shape;
static PyObject *__pyx_n_s_c_size;
static PyObject *__pyx_n_s_c_stream;
static PyObject *__pyx_n_s_c_table;
static PyObject *__pyx_n_s_c_tables;
static PyObject *__pyx_n_s_c_timezone;
static PyObject *__pyx_n_s_c_type;
static PyObject *__pyx_n_s_c_type_codes;
static PyObject *__pyx_n_s_c_type_name;
static PyObject *__pyx_n_s_cast;
static PyObject *__pyx_n_s_cat;
static PyObject *__pyx_n_s_categorical_columns;
static PyObject *__pyx_n_s_categorical_type;
static PyObject *__pyx_n_s_categories;
static PyObject *__pyx_n_s_check_metadata;
static PyObject *__pyx_n_s_child;
static PyObject *__pyx_n_s_child_field;
static PyObject *__pyx_n_s_children;
static PyObject *__pyx_n_s_children_fields;
static PyObject *__pyx_n_s_chunk;
static PyObject *__pyx_n_s_chunked_array;
static PyObject *__pyx_n_s_chunks;
static PyObject *__pyx_n_u_chunksize;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cleanup;
static PyObject *__pyx_n_s_client;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_u_close;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_u_closed;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_codec;
static PyObject *__pyx_n_s_codes;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_column;
static PyObject *__pyx_n_s_column_2;
static PyObject *__pyx_n_s_columns;
static PyObject *__pyx_n_s_common;
static PyObject *__pyx_n_s_compat;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_compress;
static PyObject *__pyx_n_s_compression;
static PyObject *__pyx_n_s_compressor;
static PyObject *__pyx_n_s_concat_arrays;
static PyObject *__pyx_n_s_concat_tables;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_n_s_converted_arrays;
static PyObject *__pyx_n_s_coords;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_core;
static PyObject *__pyx_kp_u_could_not_infer_open_mode_for_fi;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_cpool;
static PyObject *__pyx_n_s_cpp_file;
static PyObject *__pyx_n_s_cpu_count;
static PyObject *__pyx_n_s_cpy_ext_type;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_create_memory_map;
static PyObject *__pyx_n_s_csparse_tensor;
static PyObject *__pyx_n_s_ctensor;
static PyObject *__pyx_n_s_custom_deserializer;
static PyObject *__pyx_n_s_custom_serializer;
static PyObject *__pyx_n_b_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_u_data;
static PyObject *__pyx_n_s_data_frame;
static PyObject *__pyx_n_s_dataframe_to_arrays;
static PyObject *__pyx_n_s_dataframe_to_types;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_date32;
static PyObject *__pyx_n_u_date32;
static PyObject *__pyx_kp_u_date32_day;
static PyObject *__pyx_n_s_date64;
static PyObject *__pyx_n_u_date64;
static PyObject *__pyx_kp_u_date64_ms;
static PyObject *__pyx_n_s_date_as_object;
static PyObject *__pyx_n_u_date_as_object;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_kp_u_datetime64_ns;
static PyObject *__pyx_n_s_datetime_conversion_functions;
static PyObject *__pyx_n_s_datetime_conversion_functions_l;
static PyObject *__pyx_n_s_days;
static PyObject *__pyx_n_s_decay_ms;
static PyObject *__pyx_n_s_decimal;
static PyObject *__pyx_n_s_decimal128;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decompress;
static PyObject *__pyx_n_s_decompressed_size;
static PyObject *__pyx_n_s_deduplicate_objects;
static PyObject *__pyx_n_u_deduplicate_objects;
static PyObject *__pyx_n_s_default_block_size;
static PyObject *__pyx_n_s_default_context_initialized;
static PyObject *__pyx_n_s_default_memory_pool;
static PyObject *__pyx_n_s_default_serialization_context;
static PyObject *__pyx_n_u_dense;
static PyObject *__pyx_n_s_deserialize;
static PyObject *__pyx_n_s_deserialize_components;
static PyObject *__pyx_n_s_deserialize_from;
static PyObject *__pyx_n_s_deserializer;
static PyObject *__pyx_n_s_dest;
static PyObject *__pyx_n_u_detect;
static PyObject *__pyx_n_s_detect_compression;
static PyObject *__pyx_n_s_df;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_u_dict;
static PyObject *__pyx_n_s_dictionary;
static PyObject *__pyx_n_u_dictionary;
static PyObject *__pyx_n_s_dictionary_2;
static PyObject *__pyx_n_s_dictionary_memo;
static PyObject *__pyx_n_s_dictionary_value;
static PyObject *__pyx_n_s_dim_names;
static PyObject *__pyx_n_u_directory;
static PyObject *__pyx_n_s_distutils_version;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_u_double;
static PyObject *__pyx_n_s_download;
static PyObject *__pyx_n_s_download_locals_bg_write;
static PyObject *__pyx_n_s_download_locals_cleanup;
static PyObject *__pyx_n_s_driver;
static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_b_e;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_e2;
static PyObject *__pyx_n_s_enable;
static PyObject *__pyx_n_s_encode_file_path;
static PyObject *__pyx_n_s_endswith;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_equals;
static PyObject *__pyx_n_s_example_object;
static PyObject *__pyx_n_s_exc_info;
static PyObject *__pyx_n_s_exc_tb;
static PyObject *__pyx_n_s_exc_type;
static PyObject *__pyx_n_s_exc_val;
static PyObject *__pyx_n_s_exc_value;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_ext_array;
static PyObject *__pyx_n_s_ext_type;
static PyObject *__pyx_n_s_extension_name;
static PyObject *__pyx_n_s_extensions;
static PyObject *__pyx_n_s_extra_conf;
static PyObject *__pyx_n_b_f;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_u_f2;
static PyObject *__pyx_n_u_f4;
static PyObject *__pyx_n_u_f8;
static PyObject *__pyx_n_s_fastpath;
static PyObject *__pyx_n_s_field;
static PyObject *__pyx_n_s_field_2;
static PyObject *__pyx_n_s_field_3;
static PyObject *__pyx_n_s_field_names;
static PyObject *__pyx_kp_u_field_or_tuple_expected_got_None;
static PyObject *__pyx_n_s_fields;
static PyObject *__pyx_n_u_fields_2;
static PyObject *__pyx_n_u_file;
static PyObject *__pyx_n_s_file_descriptor;
static PyObject *__pyx_n_s_file_handle;
static PyObject *__pyx_n_s_file_type;
static PyObject *__pyx_n_s_fixed_offset_to_string;
static PyObject *__pyx_n_s_fixed_size_binary_type;
static PyObject *__pyx_n_s_flatten;
static PyObject *__pyx_n_u_float;
static PyObject *__pyx_n_s_float16;
static PyObject *__pyx_n_u_float16;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_u_float32;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_u_float64;
static PyObject *__pyx_n_s_footer_offset;
static PyObject *__pyx_n_s_foreign_buffer;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_from_arrays;
static PyObject *__pyx_n_s_from_batches;
static PyObject *__pyx_n_s_from_buffers;
static PyObject *__pyx_n_s_from_components;
static PyObject *__pyx_n_s_from_dense;
static PyObject *__pyx_n_s_from_dense_numpy;
static PyObject *__pyx_n_s_from_numpy;
static PyObject *__pyx_n_s_from_numpy_dtype;
static PyObject *__pyx_n_s_from_pandas;
static PyObject *__pyx_n_s_from_pydict;
static PyObject *__pyx_n_s_from_sparse;
static PyObject *__pyx_n_s_from_storage;
static PyObject *__pyx_n_s_from_tensor;
static PyObject *__pyx_n_s_frombuffer;
static PyObject *__pyx_n_s_frombytes;
static PyObject *__pyx_n_s_fromutc;
static PyObject *__pyx_n_s_full;
static PyObject *__pyx_n_s_full_info;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_batch;
static PyObject *__pyx_n_s_get_capacity;
static PyObject *__pyx_n_s_get_datetimetz_type;
static PyObject *__pyx_n_s_get_default_context;
static PyObject *__pyx_n_s_get_field_index;
static PyObject *__pyx_n_s_get_record_batch;
static PyObject *__pyx_n_s_get_record_batch_size;
static PyObject *__pyx_n_s_get_space_used;
static PyObject *__pyx_n_s_get_tensor_size;
static PyObject *__pyx_n_s_getnewargs;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_getvalue;
static PyObject *__pyx_kp_u_got_null_buffer;
static PyObject *__pyx_n_s_group;
static PyObject *__pyx_n_u_group;
static PyObject *__pyx_kp_u_gz;
static PyObject *__pyx_n_u_gzip;
static PyObject *__pyx_n_b_h;
static PyObject *__pyx_n_u_halffloat;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_handle_arrow_array_protocol;
static PyObject *__pyx_n_s_have_libhdfs;
static PyObject *__pyx_n_s_have_libhdfs3;
static PyObject *__pyx_n_s_have_pandas;
static PyObject *__pyx_kp_u_hdfs_d;
static PyObject *__pyx_n_s_hint;
static PyObject *__pyx_n_s_host;
static PyObject *__pyx_n_s_hours;
static PyObject *__pyx_n_b_i;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_u_i1;
static PyObject *__pyx_n_u_i2;
static PyObject *__pyx_n_u_i4;
static PyObject *__pyx_n_u_i8;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_ignore_metadata;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_stream;
static PyObject *__pyx_n_s_indent;
static PyObject *__pyx_kp_u_index_out_of_bounds;
static PyObject *__pyx_n_s_index_type;
static PyObject *__pyx_n_s_index_value;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_u_indices;
static PyObject *__pyx_n_s_indices_2;
static PyObject *__pyx_n_s_indptr;
static PyObject *__pyx_n_s_infer_dtype;
static PyObject *__pyx_n_s_infer_type;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_input_stream;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_int16;
static PyObject *__pyx_n_u_int16;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_u_int32;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_u_int64;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_n_u_int8;
static PyObject *__pyx_n_s_integer_object_nulls;
static PyObject *__pyx_n_u_integer_object_nulls;
static PyObject *__pyx_n_s_integer_types;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_is_alive;
static PyObject *__pyx_n_s_is_array_like;
static PyObject *__pyx_n_s_is_boolean_value;
static PyObject *__pyx_n_s_is_categorical;
static PyObject *__pyx_n_s_is_data_frame;
static PyObject *__pyx_n_s_is_datetimetz;
static PyObject *__pyx_n_s_is_float_value;
static PyObject *__pyx_n_s_is_integer_value;
static PyObject *__pyx_n_s_is_named_tuple;
static PyObject *__pyx_n_s_is_named_tuple_locals_genexpr;
static PyObject *__pyx_n_s_is_pandas_object;
static PyObject *__pyx_n_s_is_primitive;
static PyObject *__pyx_n_s_is_series;
static PyObject *__pyx_n_s_is_sparse;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_u_item;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_iterchunks;
static PyObject *__pyx_n_s_itercolumns;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_jemalloc_set_decay_ms;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_kerb_ticket;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_kp_u_key_must_either_be_a_slice_or_in;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_u_kind;
static PyObject *__pyx_n_s_large_binary;
static PyObject *__pyx_n_u_large_binary;
static PyObject *__pyx_n_s_large_list;
static PyObject *__pyx_n_u_large_str;
static PyObject *__pyx_n_s_large_string;
static PyObject *__pyx_n_u_large_string;
static PyObject *__pyx_n_s_large_utf8;
static PyObject *__pyx_n_u_large_utf8;
static PyObject *__pyx_n_u_last_access_time;
static PyObject *__pyx_n_u_last_accessed;
static PyObject *__pyx_n_u_last_modified;
static PyObject *__pyx_n_u_last_modified_time;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_level;
static PyObject *__pyx_n_s_lib;
static PyObject *__pyx_n_u_libhdfs;
static PyObject *__pyx_n_u_libhdfs3;
static PyObject *__pyx_n_s_list;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_log_memory_allocations;
static PyObject *__pyx_n_s_logging_memory_pool;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_u_lz4;
static PyObject *__pyx_kp_u_lz4_2;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_ma;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_datetimetz;
static PyObject *__pyx_n_s_make_tz_aware;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_mapping;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_kp_u_mask_not_implemented_with_Arrow;
static PyObject *__pyx_n_s_match;
static PyObject *__pyx_n_s_max_chunksize;
static PyObject *__pyx_n_s_max_output_size;
static PyObject *__pyx_n_s_memory_map;
static PyObject *__pyx_n_s_memory_pool;
static PyObject *__pyx_n_s_memoryview;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metadata;
static PyObject *__pyx_kp_u_metadata_2;
static PyObject *__pyx_n_s_metadata_length;
static PyObject *__pyx_n_s_micros;
static PyObject *__pyx_n_s_microsecond;
static PyObject *__pyx_n_s_microseconds;
static PyObject *__pyx_n_s_microseconds_to_datetime;
static PyObject *__pyx_n_s_millis;
static PyObject *__pyx_n_s_millis_to_datetime;
static PyObject *__pyx_n_s_milliseconds;
static PyObject *__pyx_n_s_minutes;
static PyObject *__pyx_n_s_mmap;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mro;
static PyObject *__pyx_n_u_ms;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_u_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_names;
static PyObject *__pyx_n_s_nan;
static PyObject *__pyx_n_s_nanoseconds_to_datetime_safe;
static PyObject *__pyx_n_s_nbytes;
static PyObject *__pyx_n_s_ndarray;
static PyObject *__pyx_n_s_ndarray_to_arrow_type;
static PyObject *__pyx_n_s_ndim;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_path;
static PyObject *__pyx_n_s_new_size;
static PyObject *__pyx_n_s_nf;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_normalize_slice;
static PyObject *__pyx_kp_u_not_registered_in_deserializati;
static PyObject *__pyx_kp_u_not_supported_for_buffer_protoc;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_u_ns;
static PyObject *__pyx_n_s_nthreads;
static PyObject *__pyx_n_s_null;
static PyObject *__pyx_n_u_null;
static PyObject *__pyx_n_s_null_bitmap;
static PyObject *__pyx_n_s_null_count;
static PyObject *__pyx_n_s_nullable;
static PyObject *__pyx_n_s_num_arrays;
static PyObject *__pyx_n_s_num_buffers;
static PyObject *__pyx_n_u_num_buffers;
static PyObject *__pyx_n_s_num_children;
static PyObject *__pyx_n_s_num_chunks;
static PyObject *__pyx_n_s_num_columns;
static PyObject *__pyx_n_s_num_ndarrays;
static PyObject *__pyx_n_u_num_ndarrays;
static PyObject *__pyx_n_s_num_record_batches;
static PyObject *__pyx_n_s_num_rows;
static PyObject *__pyx_n_s_num_tensors;
static PyObject *__pyx_n_u_num_tensors;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_o;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_object_2;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_offsets;
static PyObject *__pyx_n_s_offsets_2;
static PyObject *__pyx_kp_u_only_slices_with_step_1_supporte;
static PyObject *__pyx_kp_u_only_valid_on_readonly_files;
static PyObject *__pyx_kp_u_only_valid_on_seekable_files;
static PyObject *__pyx_kp_u_only_valid_on_writable_files;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_open_2;
static PyObject *__pyx_n_s_open_stream;
static PyObject *__pyx_n_s_options;
static PyObject *__pyx_n_s_ordered;
static PyObject *__pyx_n_u_ordered;
static PyObject *__pyx_n_s_ordered_dict;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_out_buf;
static PyObject *__pyx_n_s_output_buffer;
static PyObject *__pyx_n_s_output_length;
static PyObject *__pyx_n_s_output_size;
static PyObject *__pyx_n_s_output_stream;
static PyObject *__pyx_n_s_owned_buf;
static PyObject *__pyx_n_s_owner;
static PyObject *__pyx_n_u_owner;
static PyObject *__pyx_n_u_pa_getnewargs;
static PyObject *__pyx_kp_u_pa_input_stream_called_with_inst;
static PyObject *__pyx_kp_u_pa_output_stream_called_with_ins;
static PyObject *__pyx_n_b_pandas;
static PyObject *__pyx_n_s_pandas;
static PyObject *__pyx_n_s_pandas_api;
static PyObject *__pyx_n_s_pandas_api_types;
static PyObject *__pyx_n_s_pandas_types_dtypes;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_u_path;
static PyObject *__pyx_n_s_pd;
static PyObject *__pyx_n_u_permissions;
static PyObject *__pyx_n_s_pformat;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_u_pickle;
static PyObject *__pyx_kp_u_please_pass_it_explicitly;
static PyObject *__pyx_n_s_pool;
static PyObject *__pyx_n_u_pool;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_pprint;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_kp_u_precision_should_be_between_1_an;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_preserve_index;
static PyObject *__pyx_kp_u_prior_column_had_a_different_num;
static PyObject *__pyx_n_s_proxy_memory_pool;
static PyObject *__pyx_n_s_put_nowait;
static PyObject *__pyx_n_s_py_buffer;
static PyObject *__pyx_n_s_py_field;
static PyObject *__pyx_kp_u_pyarrow;
static PyObject *__pyx_n_s_pyarrow_2;
static PyObject *__pyx_kp_u_pyarrow_Field_0;
static PyObject *__pyx_kp_u_pyarrow_Message_type_0_metadata;
static PyObject *__pyx_kp_u_pyarrow_Message_unitialized;
static PyObject *__pyx_kp_u_pyarrow_SparseTensorCOO_type_0;
static PyObject *__pyx_kp_u_pyarrow_SparseTensorCSR_type_0;
static PyObject *__pyx_kp_u_pyarrow_Tensor_type_0_type_shap;
static PyObject *__pyx_kp_s_pyarrow_array_pxi;
static PyObject *__pyx_kp_s_pyarrow_benchmark_pxi;
static PyObject *__pyx_n_s_pyarrow_compat;
static PyObject *__pyx_kp_u_pyarrow_does_not_know_how_to_ser;
static PyObject *__pyx_kp_s_pyarrow_error_pxi;
static PyObject *__pyx_kp_s_pyarrow_io_hdfs_pxi;
static PyObject *__pyx_kp_s_pyarrow_io_pxi;
static PyObject *__pyx_kp_s_pyarrow_ipc_pxi;
static PyObject *__pyx_n_s_pyarrow_lib;
static PyObject *__pyx_kp_s_pyarrow_lib_pyx;
static PyObject *__pyx_kp_s_pyarrow_memory_pxi;
static PyObject *__pyx_n_s_pyarrow_pandas_compat;
static PyObject *__pyx_kp_s_pyarrow_scalar_pxi;
static PyObject *__pyx_n_s_pyarrow_serialization;
static PyObject *__pyx_kp_s_pyarrow_serialization_pxi;
static PyObject *__pyx_kp_s_pyarrow_table_pxi;
static PyObject *__pyx_kp_s_pyarrow_tensor_pxi;
static PyObject *__pyx_kp_s_pyarrow_types_pxi;
static PyObject *__pyx_n_s_pyarrow_util;
static PyObject *__pyx_n_s_pybuf;
static PyObject *__pyx_n_s_pydecimal;
static PyObject *__pyx_n_s_pyobj;
static PyObject *__pyx_n_s_python_extension_types_registry;
static PyObject *__pyx_n_u_pytype;
static PyObject *__pyx_n_s_pytz;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Scalar;
static PyObject *__pyx_n_s_pyx_unpickle_SerializationCont;
static PyObject *__pyx_n_s_pyx_unpickle__PandasAPIShim;
static PyObject *__pyx_n_s_pyx_unpickle__PandasConvertibl;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_b_q;
static PyObject *__pyx_n_s_qsize;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_queue;
static PyObject *__pyx_n_u_r;
static PyObject *__pyx_kp_u_r_2;
static PyObject *__pyx_kp_u_r_b;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_kp_u_rb;
static PyObject *__pyx_n_u_rb_2;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_u_read;
static PyObject *__pyx_n_s_read_message;
static PyObject *__pyx_n_s_read_next_batch;
static PyObject *__pyx_n_s_read_next_message;
static PyObject *__pyx_n_s_read_record_batch;
static PyObject *__pyx_n_s_read_schema;
static PyObject *__pyx_n_s_read_serialized;
static PyObject *__pyx_n_s_read_tensor;
static PyObject *__pyx_n_s_readable;
static PyObject *__pyx_kp_u_readable_file_expected;
static PyObject *__pyx_n_s_reader;
static PyObject *__pyx_n_s_readline;
static PyObject *__pyx_n_s_readlines;
static PyObject *__pyx_n_s_reconstruct_record_batch;
static PyObject *__pyx_n_s_reconstruct_table;
static PyObject *__pyx_n_s_record_batch;
static PyObject *__pyx_n_s_recursive;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_ref;
static PyObject *__pyx_n_s_register;
static PyObject *__pyx_n_s_register_default_serialization_h;
static PyObject *__pyx_n_s_register_extension_type;
static PyObject *__pyx_n_s_register_py_extension_type;
static PyObject *__pyx_n_s_registry_nanny;
static PyObject *__pyx_n_s_release_registry;
static PyObject *__pyx_n_s_remove_column;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_replication;
static PyObject *__pyx_n_u_replication;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_require;
static PyObject *__pyx_n_s_requirements;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_resizable;
static PyObject *__pyx_n_s_resize;
static PyObject *__pyx_n_s_restore_array;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_result_obj;
static PyObject *__pyx_n_s_rz_buffer;
static PyObject *__pyx_n_u_s;
static PyObject *__pyx_n_s_safe;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_n_s_schema;
static PyObject *__pyx_n_s_seconds;
static PyObject *__pyx_n_s_seconds_to_datetime;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_kp_s_self_ap_self_sp_array_cannot_be;
static PyObject *__pyx_kp_s_self_client_cannot_be_converted;
static PyObject *__pyx_kp_s_self_data_cannot_be_converted_to;
static PyObject *__pyx_kp_s_self_logging_pool_self_pool_cann;
static PyObject *__pyx_kp_s_self_pool_cannot_be_converted_to;
static PyObject *__pyx_kp_s_self_pool_self_proxy_pool_cannot;
static PyObject *__pyx_kp_s_self_reader_cannot_be_converted;
static PyObject *__pyx_kp_s_self_sp_array_cannot_be_converte;
static PyObject *__pyx_kp_s_self_sp_scalar_cannot_be_convert;
static PyObject *__pyx_kp_s_self_sp_sparse_tensor_self_stp_c;
static PyObject *__pyx_kp_s_self_sp_tensor_self_tp_cannot_be;
static PyObject *__pyx_kp_s_self_writer_cannot_be_converted;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_serialize;
static PyObject *__pyx_n_s_serialize_to;
static PyObject *__pyx_n_s_serialized;
static PyObject *__pyx_n_s_serializer;
static PyObject *__pyx_n_s_series;
static PyObject *__pyx_n_s_set_cpu_count;
static PyObject *__pyx_n_s_set_memcopy_threads;
static PyObject *__pyx_n_s_set_memory_pool;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_shrink_to_fit;
static PyObject *__pyx_n_s_sign;
static PyObject *__pyx_n_s_sink;
static PyObject *__pyx_n_s_six;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_u_size;
static PyObject *__pyx_n_s_skipna;
static PyObject *__pyx_n_s_sleep;
static PyObject *__pyx_n_s_slice;
static PyObject *__pyx_n_u_snappy;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_source_path;
static PyObject *__pyx_n_s_sp_chunked_array;
static PyObject *__pyx_n_s_sp_data_type;
static PyObject *__pyx_n_s_sp_tensor;
static PyObject *__pyx_n_u_sparse;
static PyObject *__pyx_n_s_stacklevel;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_storage;
static PyObject *__pyx_n_s_storage_type;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_u_str_2;
static PyObject *__pyx_n_s_stream;
static PyObject *__pyx_n_s_stream_or_path;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_n_u_string;
static PyObject *__pyx_n_s_string_to_tzinfo;
static PyObject *__pyx_n_s_string_types;
static PyObject *__pyx_n_s_stringify_path;
static PyObject *__pyx_n_s_strings_to_categorical;
static PyObject *__pyx_n_u_strings_to_categorical;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_strip_hdfs_abspath;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_struct_type;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_table;
static PyObject *__pyx_n_s_table_to_blockmanager;
static PyObject *__pyx_n_s_table_to_blocks;
static PyObject *__pyx_n_s_tables;
static PyObject *__pyx_n_s_take;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_target_schema;
static PyObject *__pyx_n_s_target_type;
static PyObject *__pyx_n_s_tb;
static PyObject *__pyx_n_s_tell;
static PyObject *__pyx_n_s_temp_memo;
static PyObject *__pyx_n_s_tensor;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_testing;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_time32;
static PyObject *__pyx_kp_u_time32_ms;
static PyObject *__pyx_kp_u_time32_s;
static PyObject *__pyx_n_s_time64;
static PyObject *__pyx_kp_u_time64_ns;
static PyObject *__pyx_kp_u_time64_us;
static PyObject *__pyx_n_s_timedelta;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_n_s_timestamp;
static PyObject *__pyx_kp_u_timestamp_ms;
static PyObject *__pyx_kp_u_timestamp_ns;
static PyObject *__pyx_kp_u_timestamp_s;
static PyObject *__pyx_kp_u_timestamp_us;
static PyObject *__pyx_n_s_timezone;
static PyObject *__pyx_n_s_to_pandas;
static PyObject *__pyx_n_s_to_pandas_2;
static PyObject *__pyx_n_s_to_pandas_dtype;
static PyObject *__pyx_n_s_to_pybytes;
static PyObject *__pyx_n_s_to_pylist;
static PyObject *__pyx_n_s_tobytes;
static PyObject *__pyx_n_s_total_allocated_bytes;
static PyObject *__pyx_n_s_total_bytes;
static PyObject *__pyx_n_s_total_seconds;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_kp_u_trying_to_write_an_immutable_buf;
static PyObject *__pyx_n_s_typ;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_kp_u_type_2;
static PyObject *__pyx_n_s_type_3;
static PyObject *__pyx_n_s_type_4;
static PyObject *__pyx_n_s_type_codes;
static PyObject *__pyx_n_s_type_for_alias;
static PyObject *__pyx_n_s_type_id;
static PyObject *__pyx_n_s_type_name;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_s_tz;
static PyObject *__pyx_n_s_tzinfo;
static PyObject *__pyx_n_s_tzinfo_to_string;
static PyObject *__pyx_n_s_tzinfo_to_string_locals_fixed_of;
static PyObject *__pyx_n_u_u1;
static PyObject *__pyx_n_u_u2;
static PyObject *__pyx_n_u_u4;
static PyObject *__pyx_n_u_u8;
static PyObject *__pyx_n_s_uint16;
static PyObject *__pyx_n_u_uint16;
static PyObject *__pyx_n_s_uint32;
static PyObject *__pyx_n_u_uint32;
static PyObject *__pyx_n_s_uint64;
static PyObject *__pyx_n_u_uint64;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_u_uint8;
static PyObject *__pyx_n_u_uncompressed;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_union_type;
static PyObject *__pyx_n_s_unit;
static PyObject *__pyx_n_s_unit_code;
static PyObject *__pyx_kp_u_unknown_driver_r;
static PyObject *__pyx_n_s_unregister_extension_type;
static PyObject *__pyx_n_s_unregister_py_extension_types;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upload;
static PyObject *__pyx_n_s_upload_locals_bg_write;
static PyObject *__pyx_n_u_us;
static PyObject *__pyx_n_s_use_legacy_format;
static PyObject *__pyx_n_s_use_memory_map;
static PyObject *__pyx_n_s_use_pandas_sentinels;
static PyObject *__pyx_n_s_use_threads;
static PyObject *__pyx_n_u_use_threads;
static PyObject *__pyx_n_s_user;
static PyObject *__pyx_n_s_utc;
static PyObject *__pyx_n_s_utcoffset;
static PyObject *__pyx_n_s_utf8;
static PyObject *__pyx_n_u_utf8;
static PyObject *__pyx_n_s_util;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_validate;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_value_offsets;
static PyObject *__pyx_n_s_value_type;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_values_2;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_u_w;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_u_wb;
static PyObject *__pyx_n_s_weakref;
static PyObject *__pyx_n_s_whence;
static PyObject *__pyx_n_s_window;
static PyObject *__pyx_n_s_with_metadata;
static PyObject *__pyx_n_s_wrapped_value;
static PyObject *__pyx_n_s_writable;
static PyObject *__pyx_kp_u_writable_file_expected;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_u_write;
static PyObject *__pyx_n_s_write_batch;
static PyObject *__pyx_n_s_write_table;
static PyObject *__pyx_n_s_write_tensor;
static PyObject *__pyx_n_s_write_to;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_zero_copy_only;
static PyObject *__pyx_n_u_zero_copy_only;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_n_s_zone;
static PyObject *__pyx_kp_u_zst;
static PyObject *__pyx_n_u_zstd;
static PyObject *__pyx_pf_7pyarrow_3lib_cpu_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_2set_cpu_count(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_count); /* proto */
static int __pyx_pf_7pyarrow_3lib_14_PandasAPIShim___init__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_4data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11have_pandas___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6compat___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_13loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20assert_frame_equal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22get_rangeindex_attribute(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_array___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10has_sparse___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_24__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_26__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ArrowKeyError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_10MemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_4default_memory_pool(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6proxy_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8logging_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10set_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12log_memory_allocations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enable); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14total_allocated_bytes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16jemalloc_set_decay_ms(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_decay_ms); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_is_primitive(CYTHON_UNUSED PyObject *__pyx_self, enum  arrow::Type::type __pyx_v_type); /* proto */
static int __pyx_pf_7pyarrow_3lib_8DataType___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_8DataType_2__init__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_2id___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_9bit_width___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12num_children___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_11num_buffers___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_4__str__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_8DataType_6__hash__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_8__reduce__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_10__repr__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12__eq__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_14equals(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_14DictionaryMemo___cinit__(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_7ordered___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10index_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8ListType___reduce__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8ListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType___reduce__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_10StructType___len__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_2__iter__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_9UnionType___len__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type___reduce__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_9precision___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_5scale___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_14extension_name___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_12storage_type___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13ExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13ExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_extension_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_4__eq__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_storage_type, CYTHON_UNUSED PyObject *__pyx_v_serialized); /* proto */
static int __pyx_pf_7pyarrow_3lib_15PyExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_15PyExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_4__reduce__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_storage_type, PyObject *__pyx_v_serialized); /* proto */
static int __pyx_pf_7pyarrow_3lib_20UnknownExtensionType___init__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20register_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ext_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22unregister_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type_name); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Field___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Field_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4equals(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_6__eq__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_10__str__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_12__repr__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_5Field_14__hash__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8nullable___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4name___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_16add_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_18with_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_20remove_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_22flatten(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4type___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Schema___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Schema_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Schema_4__len__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_6__getitem__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8__iter__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_11__reduce__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5names___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5types___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15__eq__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_17empty_table(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_19equals(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_other, int __pyx_v_check_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_21from_pandas(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, PyObject *__pyx_v_preserve_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_23field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_25_field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_27field_by_name(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_29get_field_index(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_31append(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_33insert(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_35remove(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_37set(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_39add_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_41with_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_43serialize(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_45remove_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_47__str__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_49__repr__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type, int __pyx_v_nullable, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_26null(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_28bool_(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_30uint8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_32int8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_34uint16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_36int16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_38uint32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_40int32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_42uint64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_44int64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_46tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_48string_to_tzinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_50timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_52time32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_54time64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_56date32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_58date64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_60float16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_62float32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_64float64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_66decimal128(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_precision, int __pyx_v_scale); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_68string(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_70utf8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_72binary(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_74large_binary(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_76large_string(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_78large_utf8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_80list_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_82large_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_84dictionary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index_type, PyObject *__pyx_v_value_type, int __pyx_v_ordered); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_86struct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_88union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_children_fields, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_90type_for_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_92schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_94from_numpy_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_96is_boolean_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_98is_integer_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_100is_float_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static int __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_102_register_py_extension_type(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_104_unregister_py_extension_types(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_8NullType___cinit__(struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_2__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_4as_py(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_6__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_10ArrayValue___init__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_10ArrayValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_106_box_time_milli(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_108_box_time_micro(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_110_nanoseconds_to_datetime_safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_112_microseconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_114_millis_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_116_seconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_118_datetime_conversion_functions(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_5value___get__(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_as_py(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_9ListValue___len__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_14LargeListValue___len__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_as_py(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue___getitem__(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_2as_py(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_120_ndarray_to_arrow_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_122_handle_arrow_array_protocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_124array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, PyObject *__pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_126asarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_128infer_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_mask, PyObject *__pyx_v_from_pandas); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_130_normalize_slice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrow_obj, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_7pyarrow_3lib_16_FunctionContext___cinit__(struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_132_restore_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v_memory_pool, PyObject *__pyx_v_categories, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object, int __pyx_v_use_threads, int __pyx_v_deduplicate_objects, int __pyx_v_ignore_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Array___init__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_2__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4_debug_print(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6diff(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_8cast(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10view(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_12sum(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_14unique(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_16dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_18from_pandas(PyObject *__pyx_v_obj, PyObject *__pyx_v_mask, PyObject *__pyx_v_type, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_20__reduce__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_22from_buffers(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, PyObject *__pyx_v_length, PyObject *__pyx_v_buffers, PyObject *__pyx_v_null_count, PyObject *__pyx_v_offset, PyObject *__pyx_v_children); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_24__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_27__repr__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_29format(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_31__str__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33equals(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Array_35__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_37isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_39__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_41slice(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_43take(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_45filter(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_47_to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_49__array__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_51to_numpy(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_53to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_55validate(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6offset___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_57buffers(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4type___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_5_name___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_value_offsets, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_dictionary_encode(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_10dictionary___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_7indices___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_2from_arrays(PyObject *__pyx_v_indices, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_mask, int __pyx_v_ordered, int __pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_field(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_2flatten(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_4from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_7storage___get__(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_from_storage(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_typ, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_storage); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_134concat_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static int __pyx_pf_7pyarrow_3lib_13StringBuilder___cinit__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_2append(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_4append_values(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_6finish(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_13StringBuilder_8__len__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_12ChunkedArray___cinit__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_12ChunkedArray_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4__reduce__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4data___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4type___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6length(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_12ChunkedArray_8__len__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10__repr__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_12format(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_14__str__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_16validate(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_18__iter__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_21__getitem__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_23__eq__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_25equals(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_27_to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_29__array__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_31cast(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_33dictionary_encode(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_35flatten(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_37unique(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_39slice(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10num_chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_41chunk(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_43iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_46to_pylist(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_5_name___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_136chunked_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_type); /* proto */
static int __pyx_pf_7pyarrow_3lib_11RecordBatch___cinit__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_11RecordBatch_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_4__reduce__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_11RecordBatch_6__len__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8validate(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_6schema___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_12column(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_14__getitem__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_16serialize(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_18slice(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_20equals(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_22to_pydict(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_24_to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_26from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_28from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_138_reconstruct_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_140table_to_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_options, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_categories); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Table___cinit__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Table_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_4__repr__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6validate(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_10__getitem__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12slice(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_14replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_16flatten(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_18combine_chunks(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_20__eq__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_22equals(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_24cast(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_target_schema, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_26from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_28from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_30from_pydict(PyObject *__pyx_v_mapping, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_32from_batches(PyObject *__pyx_v_batches, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_34to_batches(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_36_to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_categories, PyObject *__pyx_v_ignore_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_38to_pydict(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6schema___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_40field(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_42column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_44_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_46itercolumns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_7columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Table_49__len__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_51add_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_53append_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_55remove_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_57set_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12column_names___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_59rename_columns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_61drop(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_142_reconstruct_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_144record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_146table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_148concat_tables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tables); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Tensor___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_2__repr__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4from_numpy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_6to_numpy(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_8equals(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10__eq__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_12dim_name(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_13is_contiguous___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4size___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_7strides___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Tensor_14__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4type___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_15SparseTensorCOO___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_coords, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_8from_tensor(PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_10to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_12equals(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_14__eq__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_16dim_name(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_15SparseTensorCSR___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_indptr, PyObject *__pyx_v_indices, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_8from_tensor(PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_10to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_12equals(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_14__eq__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_16dim_name(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static void __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4__enter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6__exit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_10writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_16fileno(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_18close(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_20_assert_open(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_22_assert_readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_24_assert_writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_26_assert_seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_28size(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_30tell(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_32seek(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, int64_t __pyx_v_position, int __pyx_v_whence); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_34flush(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_36write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_38read(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_40read_at(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_42read1(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_44readall(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_46readinto(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_48readline(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_50readlines(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hint); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_52__iter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_54__next__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_56read_buffer(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_58truncate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_60writelines(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_lines); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_cleanup(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_2cleanup(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_4bg_write(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_62download(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream_or_path, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6upload_bg_write(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_64upload(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_66__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_68__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_2truncate(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_4readline(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_6readlines(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_hint); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_create(PyObject *__pyx_v_path, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_2_open(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_new_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_6fileno(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_150memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_152create_memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_size); /* proto */
static int __pyx_pf_7pyarrow_3lib_6OSFile___cinit__(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_2fileno(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int __pyx_v_num_threads); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_blocksize); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_threshold); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Buffer___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Buffer_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_4__len__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6hex(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6parent___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_8__getitem__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10slice(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_12equals(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_14__eq__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_16__reduce_ex__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_18to_pybytes(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Buffer_20__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /* proto */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_22__getsegcount__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t *__pyx_v_len_out); /* proto */
#endif
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_24__getreadbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
#endif
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_26__getwritebuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
#endif
static PyObject *__pyx_pf_7pyarrow_3lib_15ResizableBuffer_resize(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, int64_t __pyx_v_new_size, PyObject *__pyx_v_shrink_to_fit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_154allocate_buffer(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool, PyObject *__pyx_v_resizable); /* proto */
static int __pyx_pf_7pyarrow_3lib_18BufferOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_156py_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_158foreign_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_size, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_160as_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_162_detect_compression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_164compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_166decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_decompressed_size, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_168input_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_170output_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_172have_libhdfs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_174have_libhdfs3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_176strip_hdfs_abspath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_user, PyObject *__pyx_v_kerb_ticket, PyObject *__pyx_v_driver, PyObject *__pyx_v_extra_conf); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static void __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_new_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_full_info); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_owner, PyObject *__pyx_v_group); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_recursive); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_replication, PyObject *__pyx_v_default_block_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_file_handle); /* proto */
static void __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_7Message___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_7Message_2__init__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4type___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4body___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4equals(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_6serialize_to(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_sink, PyObject *__pyx_v_alignment, CYTHON_UNUSED PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8serialize(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, PyObject *__pyx_v_alignment, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_10__repr__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_13MessageReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13MessageReader_2__init__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_4open_stream(PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_6__iter__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_9read_next_message(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_11__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_13__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__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_3lib_19_CRecordBatchWriter_6close(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static void __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter__open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_footer_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6read_all(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_178get_tensor_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_180get_record_batch_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_182write_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_dest); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_184read_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_186read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_188read_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_190read_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo); /* proto */
static int __pyx_pf_7pyarrow_3lib_13FeatherWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_2open(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_4close(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_6write_array(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_col, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows_2__set__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_13FeatherReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_2open(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_source, bool __pyx_v_use_memory_map); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_4get_column_name(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_6get_column(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_192is_named_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_example_object); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_type_id); /* proto */
static int __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serializer, PyObject *__pyx_v_deserializer); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_type_, PyObject *__pyx_v_type_id, PyObject *__pyx_v_pickle, PyObject *__pyx_v_custom_serializer, PyObject *__pyx_v_custom_deserializer); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serialized_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_12serialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_14serialize_to(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_16deserialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_18deserialize_components(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_194_get_default_context(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_11total_bytes___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_sink); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4to_buffer(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_nthreads); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(PyObject *__pyx_v_components); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_8to_components(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4base___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_196serialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_198serialize_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_200read_serialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_202deserialize_from(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_204deserialize_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_components, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_206deserialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_208benchmark_PandasObjectIsNull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_210__pyx_unpickle__PandasAPIShim(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_3lib_212__pyx_unpickle_Scalar(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_3lib_214__pyx_unpickle__PandasConvertible(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_3lib_216__pyx_unpickle_SerializationContext(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_3lib_Message(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DataType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ListType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StructType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryMemo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BaseExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_PyExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Field(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Schema(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NAType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ArrayValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ScalarValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ListValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StructValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StringValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasConvertible(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Tensor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseTensorCSR(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseTensorCOO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NullArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NumericArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_IntegerArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatingPointArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StructArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ListArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StringArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ChunkedArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Table(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_RecordBatch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ResizableBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NativeFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedInputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedInputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasAPIShim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnknownExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__ExtensionRegistryNanny(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NullType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DecimalValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatScalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleScalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__FunctionContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StringBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_PythonFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryMappedFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_OSFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MockOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HadoopFileSystem(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__HdfsFileNanny(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HdfsFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MessageReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializationContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializedPyObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_iterchunks(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_itercolumns(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10_download(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_upload(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_float_0_01;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_60;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_int_1970;
static PyObject *__pyx_int_65536;
static PyObject *__pyx_int_1000000;
static PyObject *__pyx_int_93969614;
static PyObject *__pyx_int_162458991;
static PyObject *__pyx_int_222419149;
static PyObject *__pyx_int_261329190;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__225;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__234;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__236;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__238;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__240;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__242;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__244;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__246;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__248;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__250;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__252;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__254;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__256;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__258;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__262;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__270;
static PyObject *__pyx_tuple__272;
static PyObject *__pyx_tuple__274;
static PyObject *__pyx_tuple__276;
static PyObject *__pyx_tuple__278;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__282;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__285;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__304;
static PyObject *__pyx_tuple__306;
static PyObject *__pyx_tuple__308;
static PyObject *__pyx_tuple__310;
static PyObject *__pyx_tuple__312;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__326;
static PyObject *__pyx_tuple__328;
static PyObject *__pyx_tuple__330;
static PyObject *__pyx_tuple__331;
static PyObject *__pyx_tuple__332;
static PyObject *__pyx_tuple__333;
static PyObject *__pyx_tuple__334;
static PyObject *__pyx_tuple__336;
static PyObject *__pyx_tuple__338;
static PyObject *__pyx_tuple__340;
static PyObject *__pyx_tuple__342;
static PyObject *__pyx_tuple__344;
static PyObject *__pyx_tuple__346;
static PyObject *__pyx_tuple__348;
static PyObject *__pyx_tuple__350;
static PyObject *__pyx_tuple__352;
static PyObject *__pyx_tuple__354;
static PyObject *__pyx_tuple__356;
static PyObject *__pyx_tuple__358;
static PyObject *__pyx_tuple__360;
static PyObject *__pyx_tuple__362;
static PyObject *__pyx_tuple__364;
static PyObject *__pyx_tuple__366;
static PyObject *__pyx_tuple__368;
static PyObject *__pyx_tuple__370;
static PyObject *__pyx_tuple__372;
static PyObject *__pyx_tuple__374;
static PyObject *__pyx_tuple__376;
static PyObject *__pyx_tuple__378;
static PyObject *__pyx_tuple__380;
static PyObject *__pyx_tuple__382;
static PyObject *__pyx_tuple__384;
static PyObject *__pyx_tuple__386;
static PyObject *__pyx_tuple__388;
static PyObject *__pyx_tuple__390;
static PyObject *__pyx_tuple__392;
static PyObject *__pyx_tuple__394;
static PyObject *__pyx_tuple__396;
static PyObject *__pyx_tuple__398;
static PyObject *__pyx_tuple__400;
static PyObject *__pyx_tuple__402;
static PyObject *__pyx_tuple__404;
static PyObject *__pyx_tuple__406;
static PyObject *__pyx_tuple__408;
static PyObject *__pyx_tuple__410;
static PyObject *__pyx_tuple__412;
static PyObject *__pyx_tuple__414;
static PyObject *__pyx_tuple__416;
static PyObject *__pyx_tuple__418;
static PyObject *__pyx_tuple__420;
static PyObject *__pyx_tuple__422;
static PyObject *__pyx_tuple__424;
static PyObject *__pyx_tuple__426;
static PyObject *__pyx_tuple__428;
static PyObject *__pyx_tuple__430;
static PyObject *__pyx_tuple__432;
static PyObject *__pyx_tuple__434;
static PyObject *__pyx_tuple__436;
static PyObject *__pyx_tuple__438;
static PyObject *__pyx_tuple__440;
static PyObject *__pyx_tuple__442;
static PyObject *__pyx_tuple__444;
static PyObject *__pyx_tuple__446;
static PyObject *__pyx_tuple__448;
static PyObject *__pyx_tuple__450;
static PyObject *__pyx_tuple__452;
static PyObject *__pyx_tuple__454;
static PyObject *__pyx_tuple__457;
static PyObject *__pyx_tuple__459;
static PyObject *__pyx_tuple__461;
static PyObject *__pyx_tuple__463;
static PyObject *__pyx_tuple__465;
static PyObject *__pyx_tuple__467;
static PyObject *__pyx_tuple__469;
static PyObject *__pyx_tuple__471;
static PyObject *__pyx_tuple__473;
static PyObject *__pyx_tuple__475;
static PyObject *__pyx_tuple__477;
static PyObject *__pyx_tuple__479;
static PyObject *__pyx_tuple__481;
static PyObject *__pyx_tuple__483;
static PyObject *__pyx_tuple__485;
static PyObject *__pyx_tuple__487;
static PyObject *__pyx_tuple__489;
static PyObject *__pyx_tuple__491;
static PyObject *__pyx_tuple__493;
static PyObject *__pyx_tuple__495;
static PyObject *__pyx_tuple__497;
static PyObject *__pyx_tuple__499;
static PyObject *__pyx_tuple__501;
static PyObject *__pyx_tuple__503;
static PyObject *__pyx_tuple__505;
static PyObject *__pyx_codeobj__31;
static PyObject *__pyx_codeobj__182;
static PyObject *__pyx_codeobj__183;
static PyObject *__pyx_codeobj__185;
static PyObject *__pyx_codeobj__187;
static PyObject *__pyx_codeobj__265;
static PyObject *__pyx_codeobj__267;
static PyObject *__pyx_codeobj__269;
static PyObject *__pyx_codeobj__271;
static PyObject *__pyx_codeobj__273;
static PyObject *__pyx_codeobj__275;
static PyObject *__pyx_codeobj__277;
static PyObject *__pyx_codeobj__279;
static PyObject *__pyx_codeobj__281;
static PyObject *__pyx_codeobj__283;
static PyObject *__pyx_codeobj__286;
static PyObject *__pyx_codeobj__288;
static PyObject *__pyx_codeobj__290;
static PyObject *__pyx_codeobj__292;
static PyObject *__pyx_codeobj__293;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__295;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__297;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__299;
static PyObject *__pyx_codeobj__300;
static PyObject *__pyx_codeobj__301;
static PyObject *__pyx_codeobj__302;
static PyObject *__pyx_codeobj__305;
static PyObject *__pyx_codeobj__307;
static PyObject *__pyx_codeobj__309;
static PyObject *__pyx_codeobj__311;
static PyObject *__pyx_codeobj__313;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__315;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__317;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__319;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__323;
static PyObject *__pyx_codeobj__324;
static PyObject *__pyx_codeobj__325;
static PyObject *__pyx_codeobj__327;
static PyObject *__pyx_codeobj__329;
static PyObject *__pyx_codeobj__335;
static PyObject *__pyx_codeobj__337;
static PyObject *__pyx_codeobj__339;
static PyObject *__pyx_codeobj__341;
static PyObject *__pyx_codeobj__343;
static PyObject *__pyx_codeobj__345;
static PyObject *__pyx_codeobj__347;
static PyObject *__pyx_codeobj__349;
static PyObject *__pyx_codeobj__351;
static PyObject *__pyx_codeobj__353;
static PyObject *__pyx_codeobj__355;
static PyObject *__pyx_codeobj__357;
static PyObject *__pyx_codeobj__359;
static PyObject *__pyx_codeobj__361;
static PyObject *__pyx_codeobj__363;
static PyObject *__pyx_codeobj__365;
static PyObject *__pyx_codeobj__367;
static PyObject *__pyx_codeobj__369;
static PyObject *__pyx_codeobj__371;
static PyObject *__pyx_codeobj__373;
static PyObject *__pyx_codeobj__375;
static PyObject *__pyx_codeobj__377;
static PyObject *__pyx_codeobj__379;
static PyObject *__pyx_codeobj__381;
static PyObject *__pyx_codeobj__383;
static PyObject *__pyx_codeobj__385;
static PyObject *__pyx_codeobj__387;
static PyObject *__pyx_codeobj__389;
static PyObject *__pyx_codeobj__391;
static PyObject *__pyx_codeobj__393;
static PyObject *__pyx_codeobj__395;
static PyObject *__pyx_codeobj__397;
static PyObject *__pyx_codeobj__399;
static PyObject *__pyx_codeobj__401;
static PyObject *__pyx_codeobj__403;
static PyObject *__pyx_codeobj__405;
static PyObject *__pyx_codeobj__407;
static PyObject *__pyx_codeobj__409;
static PyObject *__pyx_codeobj__411;
static PyObject *__pyx_codeobj__413;
static PyObject *__pyx_codeobj__415;
static PyObject *__pyx_codeobj__417;
static PyObject *__pyx_codeobj__419;
static PyObject *__pyx_codeobj__421;
static PyObject *__pyx_codeobj__423;
static PyObject *__pyx_codeobj__425;
static PyObject *__pyx_codeobj__427;
static PyObject *__pyx_codeobj__429;
static PyObject *__pyx_codeobj__431;
static PyObject *__pyx_codeobj__433;
static PyObject *__pyx_codeobj__435;
static PyObject *__pyx_codeobj__437;
static PyObject *__pyx_codeobj__439;
static PyObject *__pyx_codeobj__441;
static PyObject *__pyx_codeobj__443;
static PyObject *__pyx_codeobj__445;
static PyObject *__pyx_codeobj__447;
static PyObject *__pyx_codeobj__449;
static PyObject *__pyx_codeobj__451;
static PyObject *__pyx_codeobj__453;
static PyObject *__pyx_codeobj__455;
static PyObject *__pyx_codeobj__456;
static PyObject *__pyx_codeobj__458;
static PyObject *__pyx_codeobj__460;
static PyObject *__pyx_codeobj__462;
static PyObject *__pyx_codeobj__464;
static PyObject *__pyx_codeobj__466;
static PyObject *__pyx_codeobj__468;
static PyObject *__pyx_codeobj__470;
static PyObject *__pyx_codeobj__472;
static PyObject *__pyx_codeobj__474;
static PyObject *__pyx_codeobj__476;
static PyObject *__pyx_codeobj__478;
static PyObject *__pyx_codeobj__480;
static PyObject *__pyx_codeobj__482;
static PyObject *__pyx_codeobj__484;
static PyObject *__pyx_codeobj__486;
static PyObject *__pyx_codeobj__488;
static PyObject *__pyx_codeobj__490;
static PyObject *__pyx_codeobj__492;
static PyObject *__pyx_codeobj__494;
static PyObject *__pyx_codeobj__496;
static PyObject *__pyx_codeobj__498;
static PyObject *__pyx_codeobj__500;
static PyObject *__pyx_codeobj__502;
static PyObject *__pyx_codeobj__504;
static PyObject *__pyx_codeobj__506;
/* Late includes */

/* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_1cpu_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_cpu_count[] = "cpu_count()\n\n    Return the number of threads to use in parallel operations.\n\n    The number of threads is determined at startup by inspecting the\n    ``OMP_NUM_THREADS`` and ``OMP_THREAD_LIMIT`` environment variables.\n    If neither is present, it will default to the number of hardware threads\n    on the system.  It can be modified at runtime by calling\n    :func:`set_cpu_count()`.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_1cpu_count = {"cpu_count", (PyCFunction)__pyx_pw_7pyarrow_3lib_1cpu_count, METH_NOARGS, __pyx_doc_7pyarrow_3lib_cpu_count};
static PyObject *__pyx_pw_7pyarrow_3lib_1cpu_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cpu_count (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_cpu_count(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_cpu_count(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cpu_count", 0);

  /* "pyarrow/lib.pyx":57
 *     :func:`set_cpu_count()`.
 *     """
 *     return GetCpuThreadPoolCapacity()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(arrow::GetCpuThreadPoolCapacity()); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */

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

/* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_3set_cpu_count(PyObject *__pyx_self, PyObject *__pyx_arg_count); /*proto*/
static char __pyx_doc_7pyarrow_3lib_2set_cpu_count[] = "set_cpu_count(int count)\n\n    Set the number of threads to use in parallel operations.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_3set_cpu_count = {"set_cpu_count", (PyCFunction)__pyx_pw_7pyarrow_3lib_3set_cpu_count, METH_O, __pyx_doc_7pyarrow_3lib_2set_cpu_count};
static PyObject *__pyx_pw_7pyarrow_3lib_3set_cpu_count(PyObject *__pyx_self, PyObject *__pyx_arg_count) {
  int __pyx_v_count;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_cpu_count (wrapper)", 0);
  assert(__pyx_arg_count); {
    __pyx_v_count = __Pyx_PyInt_As_int(__pyx_arg_count); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 60, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.set_cpu_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_2set_cpu_count(__pyx_self, ((int)__pyx_v_count));

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

static PyObject *__pyx_pf_7pyarrow_3lib_2set_cpu_count(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_count) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("set_cpu_count", 0);

  /* "pyarrow/lib.pyx":64
 *     Set the number of threads to use in parallel operations.
 *     """
 *     if count < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("CPU count must be strictly positive")
 *     check_status(SetCpuThreadPoolCapacity(count))
 */
  __pyx_t_1 = ((__pyx_v_count < 1) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/lib.pyx":65
 *     """
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")             # <<<<<<<<<<<<<<
 *     check_status(SetCpuThreadPoolCapacity(count))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 65, __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(8, 65, __pyx_L1_error)

    /* "pyarrow/lib.pyx":64
 *     Set the number of threads to use in parallel operations.
 *     """
 *     if count < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("CPU count must be strictly positive")
 *     check_status(SetCpuThreadPoolCapacity(count))
 */
  }

  /* "pyarrow/lib.pyx":66
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")
 *     check_status(SetCpuThreadPoolCapacity(count))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::SetCpuThreadPoolCapacity(__pyx_v_count)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 66, __pyx_L1_error)

  /* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */

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

/* "pyarrow/pandas-shim.pxi":37
 *         bint has_sparse
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0
 */

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

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

static int __pyx_pf_7pyarrow_3lib_14_PandasAPIShim___init__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/pandas-shim.pxi":38
 * 
 *     def __init__(self):
 *         self._tried_importing_pandas = False             # <<<<<<<<<<<<<<
 *         self._have_pandas = 0
 * 
 */
  __pyx_v_self->_tried_importing_pandas = 0;

  /* "pyarrow/pandas-shim.pxi":39
 *     def __init__(self):
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef _import_pandas(self, bint raise_):
 */
  __pyx_v_self->_have_pandas = 0;

  /* "pyarrow/pandas-shim.pxi":37
 *         bint has_sparse
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0
 */

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

/* "pyarrow/pandas-shim.pxi":41
 *         self._have_pandas = 0
 * 
 *     cdef _import_pandas(self, bint raise_):             # <<<<<<<<<<<<<<
 *         try:
 *             import pandas as pd
 */

static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, int __pyx_v_raise_) {
  PyObject *__pyx_v_pd = NULL;
  PyObject *__pyx_v_pdcompat = NULL;
  PyObject *__pyx_v_LooseVersion = NULL;
  PyObject *__pyx_v_DatetimeTZDtype = 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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_import_pandas", 0);

  /* "pyarrow/pandas-shim.pxi":42
 * 
 *     cdef _import_pandas(self, bint raise_):
 *         try:             # <<<<<<<<<<<<<<
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 */
  {
    __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/pandas-shim.pxi":43
 *     cdef _import_pandas(self, bint raise_):
 *         try:
 *             import pandas as pd             # <<<<<<<<<<<<<<
 *             import pyarrow.pandas_compat as pdcompat
 *         except ImportError:
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 43, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pd = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/pandas-shim.pxi":44
 *         try:
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             self._have_pandas = False
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 44, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_n_s__2);
      __Pyx_GIVEREF(__pyx_n_s__2);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s__2);
      __pyx_t_5 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 44, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_pdcompat = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/pandas-shim.pxi":42
 * 
 *     cdef _import_pandas(self, bint raise_):
 *         try:             # <<<<<<<<<<<<<<
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 */
    }
    __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/pandas-shim.pxi":45
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             self._have_pandas = False
 *             if raise_:
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim._import_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(3, 45, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/pandas-shim.pxi":46
 *             import pyarrow.pandas_compat as pdcompat
 *         except ImportError:
 *             self._have_pandas = False             # <<<<<<<<<<<<<<
 *             if raise_:
 *                 raise
 */
      __pyx_v_self->_have_pandas = 0;

      /* "pyarrow/pandas-shim.pxi":47
 *         except ImportError:
 *             self._have_pandas = False
 *             if raise_:             # <<<<<<<<<<<<<<
 *                 raise
 *             else:
 */
      __pyx_t_8 = (__pyx_v_raise_ != 0);
      if (unlikely(__pyx_t_8)) {

        /* "pyarrow/pandas-shim.pxi":48
 *             self._have_pandas = False
 *             if raise_:
 *                 raise             # <<<<<<<<<<<<<<
 *             else:
 *                 return
 */
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_7);
        __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; 
        __PYX_ERR(3, 48, __pyx_L5_except_error)

        /* "pyarrow/pandas-shim.pxi":47
 *         except ImportError:
 *             self._have_pandas = False
 *             if raise_:             # <<<<<<<<<<<<<<
 *                 raise
 *             else:
 */
      }

      /* "pyarrow/pandas-shim.pxi":50
 *                 raise
 *             else:
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         self._pd = pd
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L6_except_return;
      }
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/pandas-shim.pxi":42
 * 
 *     cdef _import_pandas(self, bint raise_):
 *         try:             # <<<<<<<<<<<<<<
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 */
    __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/pandas-shim.pxi":52
 *                 return
 * 
 *         self._pd = pd             # <<<<<<<<<<<<<<
 *         self._version = pd.__version__
 *         from distutils.version import LooseVersion
 */
  __Pyx_INCREF(__pyx_v_pd);
  __Pyx_GIVEREF(__pyx_v_pd);
  __Pyx_GOTREF(__pyx_v_self->_pd);
  __Pyx_DECREF(__pyx_v_self->_pd);
  __pyx_v_self->_pd = __pyx_v_pd;

  /* "pyarrow/pandas-shim.pxi":53
 * 
 *         self._pd = pd
 *         self._version = pd.__version__             # <<<<<<<<<<<<<<
 *         from distutils.version import LooseVersion
 *         self._loose_version = LooseVersion(pd.__version__)
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_version); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->_version);
  __Pyx_DECREF(__pyx_v_self->_version);
  __pyx_v_self->_version = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyarrow/pandas-shim.pxi":54
 *         self._pd = pd
 *         self._version = pd.__version__
 *         from distutils.version import LooseVersion             # <<<<<<<<<<<<<<
 *         self._loose_version = LooseVersion(pd.__version__)
 * 
 */
  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_s_LooseVersion);
  __Pyx_GIVEREF(__pyx_n_s_LooseVersion);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_LooseVersion);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_distutils_version, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_v_LooseVersion = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":55
 *         self._version = pd.__version__
 *         from distutils.version import LooseVersion
 *         self._loose_version = LooseVersion(pd.__version__)             # <<<<<<<<<<<<<<
 * 
 *         self._compat_module = pdcompat
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_version); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_5 = __pyx_v_LooseVersion; __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_loose_version);
  __Pyx_DECREF(__pyx_v_self->_loose_version);
  __pyx_v_self->_loose_version = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":57
 *         self._loose_version = LooseVersion(pd.__version__)
 * 
 *         self._compat_module = pdcompat             # <<<<<<<<<<<<<<
 *         self._data_frame = pd.DataFrame
 *         self._index = pd.Index
 */
  __Pyx_INCREF(__pyx_v_pdcompat);
  __Pyx_GIVEREF(__pyx_v_pdcompat);
  __Pyx_GOTREF(__pyx_v_self->_compat_module);
  __Pyx_DECREF(__pyx_v_self->_compat_module);
  __pyx_v_self->_compat_module = __pyx_v_pdcompat;

  /* "pyarrow/pandas-shim.pxi":58
 * 
 *         self._compat_module = pdcompat
 *         self._data_frame = pd.DataFrame             # <<<<<<<<<<<<<<
 *         self._index = pd.Index
 *         self._categorical_type = pd.Categorical
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_data_frame);
  __Pyx_DECREF(__pyx_v_self->_data_frame);
  __pyx_v_self->_data_frame = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":59
 *         self._compat_module = pdcompat
 *         self._data_frame = pd.DataFrame
 *         self._index = pd.Index             # <<<<<<<<<<<<<<
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Index); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_index);
  __Pyx_DECREF(__pyx_v_self->_index);
  __pyx_v_self->_index = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":60
 *         self._data_frame = pd.DataFrame
 *         self._index = pd.Index
 *         self._categorical_type = pd.Categorical             # <<<<<<<<<<<<<<
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Categorical); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_categorical_type);
  __Pyx_DECREF(__pyx_v_self->_categorical_type);
  __pyx_v_self->_categorical_type = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":61
 *         self._index = pd.Index
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series             # <<<<<<<<<<<<<<
 *         if self._loose_version >= LooseVersion('0.23.0'):
 *             self._extension_array = pd.api.extensions.ExtensionArray
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Series); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_series);
  __Pyx_DECREF(__pyx_v_self->_series);
  __pyx_v_self->_series = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":62
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):             # <<<<<<<<<<<<<<
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_5 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_kp_u_0_23_0) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_0_23_0);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":63
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):
 *             self._extension_array = pd.api.extensions.ExtensionArray             # <<<<<<<<<<<<<<
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type,
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_api); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_extensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ExtensionArray); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_extension_array);
    __Pyx_DECREF(__pyx_v_self->_extension_array);
    __pyx_v_self->_extension_array = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":65
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type,             # <<<<<<<<<<<<<<
 *                 self._extension_array)
 *         else:
 */
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->_series);
    __Pyx_GIVEREF(__pyx_v_self->_series);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_series);
    __Pyx_INCREF(__pyx_v_self->_index);
    __Pyx_GIVEREF(__pyx_v_self->_index);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_index);
    __Pyx_INCREF(__pyx_v_self->_categorical_type);
    __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_categorical_type);
    __Pyx_INCREF(__pyx_v_self->_extension_array);
    __Pyx_GIVEREF(__pyx_v_self->_extension_array);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_self->_extension_array);

    /* "pyarrow/pandas-shim.pxi":64
 *         if self._loose_version >= LooseVersion('0.23.0'):
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (             # <<<<<<<<<<<<<<
 *                 self._series, self._index, self._categorical_type,
 *                 self._extension_array)
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_array_like_types);
    __Pyx_DECREF(__pyx_v_self->_array_like_types);
    __pyx_v_self->_array_like_types = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":62
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):             # <<<<<<<<<<<<<<
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (
 */
    goto __pyx_L12;
  }

  /* "pyarrow/pandas-shim.pxi":68
 *                 self._extension_array)
 *         else:
 *             self._extension_array = None             # <<<<<<<<<<<<<<
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type)
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->_extension_array);
    __Pyx_DECREF(__pyx_v_self->_extension_array);
    __pyx_v_self->_extension_array = Py_None;

    /* "pyarrow/pandas-shim.pxi":70
 *             self._extension_array = None
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type)             # <<<<<<<<<<<<<<
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):
 */
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->_series);
    __Pyx_GIVEREF(__pyx_v_self->_series);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_series);
    __Pyx_INCREF(__pyx_v_self->_index);
    __Pyx_GIVEREF(__pyx_v_self->_index);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_index);
    __Pyx_INCREF(__pyx_v_self->_categorical_type);
    __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_categorical_type);

    /* "pyarrow/pandas-shim.pxi":69
 *         else:
 *             self._extension_array = None
 *             self._array_like_types = (             # <<<<<<<<<<<<<<
 *                 self._series, self._index, self._categorical_type)
 * 
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_array_like_types);
    __Pyx_DECREF(__pyx_v_self->_array_like_types);
    __pyx_v_self->_array_like_types = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L12:;

  /* "pyarrow/pandas-shim.pxi":72
 *                 self._series, self._index, self._categorical_type)
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):             # <<<<<<<<<<<<<<
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_4 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_kp_u_0_20_0) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_0_20_0);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":73
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):
 *             from pandas.api.types import DatetimeTZDtype             # <<<<<<<<<<<<<<
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_DatetimeTZDtype);
    __Pyx_GIVEREF(__pyx_n_s_DatetimeTZDtype);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_DatetimeTZDtype);
    __pyx_t_5 = __Pyx_Import(__pyx_n_s_pandas_api_types, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_DatetimeTZDtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_DatetimeTZDtype = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":74
 *         if self._loose_version >= LooseVersion('0.20.0'):
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types             # <<<<<<<<<<<<<<
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 *             from pandas.types.dtypes import DatetimeTZDtype
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_api); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->_types_api);
    __Pyx_DECREF(__pyx_v_self->_types_api);
    __pyx_v_self->_types_api = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":72
 *                 self._series, self._index, self._categorical_type)
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):             # <<<<<<<<<<<<<<
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
    goto __pyx_L13;
  }

  /* "pyarrow/pandas-shim.pxi":75
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):             # <<<<<<<<<<<<<<
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_5 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_kp_u_0_19_0) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_0_19_0);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":76
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 *             from pandas.types.dtypes import DatetimeTZDtype             # <<<<<<<<<<<<<<
 *             self._types_api = pd.api.types
 *         else:
 */
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_n_s_DatetimeTZDtype);
    __Pyx_GIVEREF(__pyx_n_s_DatetimeTZDtype);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_DatetimeTZDtype);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas_types_dtypes, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_DatetimeTZDtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_DatetimeTZDtype = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":77
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.api.types             # <<<<<<<<<<<<<<
 *         else:
 *             from pandas.types.dtypes import DatetimeTZDtype
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_api); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_types_api);
    __Pyx_DECREF(__pyx_v_self->_types_api);
    __pyx_v_self->_types_api = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":75
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):             # <<<<<<<<<<<<<<
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
    goto __pyx_L13;
  }

  /* "pyarrow/pandas-shim.pxi":79
 *             self._types_api = pd.api.types
 *         else:
 *             from pandas.types.dtypes import DatetimeTZDtype             # <<<<<<<<<<<<<<
 *             self._types_api = pd.core.common
 * 
 */
  /*else*/ {
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_n_s_DatetimeTZDtype);
    __Pyx_GIVEREF(__pyx_n_s_DatetimeTZDtype);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_DatetimeTZDtype);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas_types_dtypes, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_DatetimeTZDtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_DatetimeTZDtype = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":80
 *         else:
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.core.common             # <<<<<<<<<<<<<<
 * 
 *         self._datetimetz_type = DatetimeTZDtype
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_common); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_types_api);
    __Pyx_DECREF(__pyx_v_self->_types_api);
    __pyx_v_self->_types_api = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L13:;

  /* "pyarrow/pandas-shim.pxi":82
 *             self._types_api = pd.core.common
 * 
 *         self._datetimetz_type = DatetimeTZDtype             # <<<<<<<<<<<<<<
 *         self._have_pandas = True
 * 
 */
  __Pyx_INCREF(__pyx_v_DatetimeTZDtype);
  __Pyx_GIVEREF(__pyx_v_DatetimeTZDtype);
  __Pyx_GOTREF(__pyx_v_self->_datetimetz_type);
  __Pyx_DECREF(__pyx_v_self->_datetimetz_type);
  __pyx_v_self->_datetimetz_type = __pyx_v_DatetimeTZDtype;

  /* "pyarrow/pandas-shim.pxi":83
 * 
 *         self._datetimetz_type = DatetimeTZDtype
 *         self._have_pandas = True             # <<<<<<<<<<<<<<
 * 
 *         if self._loose_version > LooseVersion('0.25'):
 */
  __pyx_v_self->_have_pandas = 1;

  /* "pyarrow/pandas-shim.pxi":85
 *         self._have_pandas = True
 * 
 *         if self._loose_version > LooseVersion('0.25'):             # <<<<<<<<<<<<<<
 *             self.has_sparse = False
 *         else:
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_4 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_kp_u_0_25) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_0_25);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":86
 * 
 *         if self._loose_version > LooseVersion('0.25'):
 *             self.has_sparse = False             # <<<<<<<<<<<<<<
 *         else:
 *             self.has_sparse = True
 */
    __pyx_v_self->has_sparse = 0;

    /* "pyarrow/pandas-shim.pxi":85
 *         self._have_pandas = True
 * 
 *         if self._loose_version > LooseVersion('0.25'):             # <<<<<<<<<<<<<<
 *             self.has_sparse = False
 *         else:
 */
    goto __pyx_L14;
  }

  /* "pyarrow/pandas-shim.pxi":88
 *             self.has_sparse = False
 *         else:
 *             self.has_sparse = True             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _check_import(self, bint raise_=True):
 */
  /*else*/ {
    __pyx_v_self->has_sparse = 1;
  }
  __pyx_L14:;

  /* "pyarrow/pandas-shim.pxi":41
 *         self._have_pandas = 0
 * 
 *     cdef _import_pandas(self, bint raise_):             # <<<<<<<<<<<<<<
 *         try:
 *             import pandas as pd
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim._import_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pd);
  __Pyx_XDECREF(__pyx_v_pdcompat);
  __Pyx_XDECREF(__pyx_v_LooseVersion);
  __Pyx_XDECREF(__pyx_v_DatetimeTZDtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":90
 *             self.has_sparse = True
 * 
 *     cdef inline _check_import(self, bint raise_=True):             # <<<<<<<<<<<<<<
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 */

static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args) {
  int __pyx_v_raise_ = ((int)1);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_check_import", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_raise_ = __pyx_optional_args->raise_;
    }
  }

  /* "pyarrow/pandas-shim.pxi":91
 * 
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)
 */
  __pyx_t_1 = (__pyx_v_self->_tried_importing_pandas != 0);
  if (__pyx_t_1) {

    /* "pyarrow/pandas-shim.pxi":92
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:             # <<<<<<<<<<<<<<
 *                 self._import_pandas(raise_)
 *             return
 */
    __pyx_t_2 = ((!(__pyx_v_self->_have_pandas != 0)) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_raise_ != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "pyarrow/pandas-shim.pxi":93
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self->__pyx_vtab)->_import_pandas(__pyx_v_self, __pyx_v_raise_); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyarrow/pandas-shim.pxi":92
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:             # <<<<<<<<<<<<<<
 *                 self._import_pandas(raise_)
 *             return
 */
    }

    /* "pyarrow/pandas-shim.pxi":94
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._tried_importing_pandas = True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":91
 * 
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)
 */
  }

  /* "pyarrow/pandas-shim.pxi":96
 *             return
 * 
 *         self._tried_importing_pandas = True             # <<<<<<<<<<<<<<
 *         self._import_pandas(raise_)
 * 
 */
  __pyx_v_self->_tried_importing_pandas = 1;

  /* "pyarrow/pandas-shim.pxi":97
 * 
 *         self._tried_importing_pandas = True
 *         self._import_pandas(raise_)             # <<<<<<<<<<<<<<
 * 
 *     def series(self, *args, **kwargs):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self->__pyx_vtab)->_import_pandas(__pyx_v_self, __pyx_v_raise_); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/pandas-shim.pxi":90
 *             self.has_sparse = True
 * 
 *     cdef inline _check_import(self, bint raise_=True):             # <<<<<<<<<<<<<<
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 */

  /* 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.lib._PandasAPIShim._check_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":99
 *         self._import_pandas(raise_)
 * 
 *     def series(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._series(*args, **kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_2series[] = "_PandasAPIShim.series(self, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("series (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "series", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2series(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("series", 0);

  /* "pyarrow/pandas-shim.pxi":100
 * 
 *     def series(self, *args, **kwargs):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._series(*args, **kwargs)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":101
 *     def series(self, *args, **kwargs):
 *         self._check_import()
 *         return self._series(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def data_frame(self, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->_series, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":99
 *         self._import_pandas(raise_)
 * 
 *     def series(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._series(*args, **kwargs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":103
 *         return self._series(*args, **kwargs)
 * 
 *     def data_frame(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._data_frame(*args, **kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_5data_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_4data_frame[] = "_PandasAPIShim.data_frame(self, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_5data_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("data_frame (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "data_frame", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_4data_frame(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_4data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("data_frame", 0);

  /* "pyarrow/pandas-shim.pxi":104
 * 
 *     def data_frame(self, *args, **kwargs):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._data_frame(*args, **kwargs)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":105
 *     def data_frame(self, *args, **kwargs):
 *         self._check_import()
 *         return self._data_frame(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline bint _have_pandas_internal(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->_data_frame, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":103
 *         return self._series(*args, **kwargs)
 * 
 *     def data_frame(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._data_frame(*args, **kwargs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.data_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":107
 *         return self._data_frame(*args, **kwargs)
 * 
 *     cdef inline bint _have_pandas_internal(self):             # <<<<<<<<<<<<<<
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)
 */

static CYTHON_INLINE int __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import __pyx_t_3;
  __Pyx_RefNannySetupContext("_have_pandas_internal", 0);

  /* "pyarrow/pandas-shim.pxi":108
 * 
 *     cdef inline bint _have_pandas_internal(self):
 *         if not self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             self._check_import(raise_=False)
 *         return self._have_pandas
 */
  __pyx_t_1 = ((!(__pyx_v_self->_tried_importing_pandas != 0)) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/pandas-shim.pxi":109
 *     cdef inline bint _have_pandas_internal(self):
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)             # <<<<<<<<<<<<<<
 *         return self._have_pandas
 * 
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.raise_ = 0;
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/pandas-shim.pxi":108
 * 
 *     cdef inline bint _have_pandas_internal(self):
 *         if not self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             self._check_import(raise_=False)
 *         return self._have_pandas
 */
  }

  /* "pyarrow/pandas-shim.pxi":110
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)
 *         return self._have_pandas             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_r = __pyx_v_self->_have_pandas;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":107
 *         return self._data_frame(*args, **kwargs)
 * 
 *     cdef inline bint _have_pandas_internal(self):             # <<<<<<<<<<<<<<
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyarrow.lib._PandasAPIShim._have_pandas_internal", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":113
 * 
 *     @property
 *     def have_pandas(self):             # <<<<<<<<<<<<<<
 *         return self._have_pandas_internal()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11have_pandas_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11have_pandas_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11have_pandas___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11have_pandas___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":114
 *     @property
 *     def have_pandas(self):
 *         return self._have_pandas_internal()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":113
 * 
 *     @property
 *     def have_pandas(self):             # <<<<<<<<<<<<<<
 *         return self._have_pandas_internal()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.have_pandas.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":117
 * 
 *     @property
 *     def compat(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._compat_module
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6compat_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6compat_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6compat___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6compat___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":118
 *     @property
 *     def compat(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._compat_module
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":119
 *     def compat(self):
 *         self._check_import()
 *         return self._compat_module             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __pyx_r = __pyx_v_self->_compat_module;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":117
 * 
 *     @property
 *     def compat(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._compat_module
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.compat.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":122
 * 
 *     @property
 *     def pd(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_2pd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_2pd_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2pd___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":123
 *     @property
 *     def pd(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._pd
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":124
 *     def pd(self):
 *         self._check_import()
 *         return self._pd             # <<<<<<<<<<<<<<
 * 
 *     cpdef infer_dtype(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __pyx_r = __pyx_v_self->_pd;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":122
 * 
 *     @property
 *     def pd(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.pd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":126
 *         return self._pd
 * 
 *     cpdef infer_dtype(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         try:
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("infer_dtype", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_infer_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 126, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":127
 * 
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         try:
 *             return self._types_api.infer_dtype(obj, skipna=False)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":128
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 */
  {
    __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/pandas-shim.pxi":129
 *         self._check_import()
 *         try:
 *             return self._types_api.infer_dtype(obj, skipna=False)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             return self._pd.lib.infer_dtype(obj)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_types_api, __pyx_n_s_infer_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 129, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 129, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 129, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_skipna, Py_False) < 0) __PYX_ERR(3, 129, __pyx_L3_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 129, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/pandas-shim.pxi":128
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 */
    }
    __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/pandas-shim.pxi":130
 *         try:
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             return self._pd.lib.infer_dtype(obj)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(3, 130, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_2);

      /* "pyarrow/pandas-shim.pxi":131
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 *             return self._pd.lib.infer_dtype(obj)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_pd, __pyx_n_s_lib); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 131, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_infer_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 131, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_obj);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 131, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/pandas-shim.pxi":128
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 */
    __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_L7_try_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_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;
  }

  /* "pyarrow/pandas-shim.pxi":126
 *         return self._pd
 * 
 *     cpdef infer_dtype(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         try:
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype[] = "_PandasAPIShim.infer_dtype(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("infer_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("infer_dtype", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":134
 * 
 *     @property
 *     def loose_version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._loose_version
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13loose_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13loose_version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_13loose_version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_13loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":135
 *     @property
 *     def loose_version(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._loose_version
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":136
 *     def loose_version(self):
 *         self._check_import()
 *         return self._loose_version             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __pyx_r = __pyx_v_self->_loose_version;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":134
 * 
 *     @property
 *     def loose_version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._loose_version
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.loose_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":139
 * 
 *     @property
 *     def version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._version
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":140
 *     @property
 *     def version(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._version
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":141
 *     def version(self):
 *         self._check_import()
 *         return self._version             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_version);
  __pyx_r = __pyx_v_self->_version;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":139
 * 
 *     @property
 *     def version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._version
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":144
 * 
 *     @property
 *     def categorical_type(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._categorical_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16categorical_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16categorical_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16categorical_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":145
 *     @property
 *     def categorical_type(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._categorical_type
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":146
 *     def categorical_type(self):
 *         self._check_import()
 *         return self._categorical_type             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __pyx_r = __pyx_v_self->_categorical_type;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":144
 * 
 *     @property
 *     def categorical_type(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._categorical_type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.categorical_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":149
 * 
 *     @property
 *     def datetimetz_type(self):             # <<<<<<<<<<<<<<
 *         return self._datetimetz_type
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":150
 *     @property
 *     def datetimetz_type(self):
 *         return self._datetimetz_type             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_array_like(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __pyx_r = __pyx_v_self->_datetimetz_type;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":149
 * 
 *     @property
 *     def datetimetz_type(self):             # <<<<<<<<<<<<<<
 *         return self._datetimetz_type
 * 
 */

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

/* "pyarrow/pandas-shim.pxi":152
 *         return self._datetimetz_type
 * 
 *     cpdef is_array_like(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_array_like", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_array_like); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 152, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":153
 * 
 *     cpdef is_array_like(self, obj):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return isinstance(obj, self._array_like_types)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":154
 *     cpdef is_array_like(self, obj):
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_categorical(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_array_like_types;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":152
 *         return self._datetimetz_type
 * 
 *     cpdef is_array_like(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)
 */

  /* 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.lib._PandasAPIShim.is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_8is_array_like[] = "_PandasAPIShim.is_array_like(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_array_like (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8is_array_like(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_array_like", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":156
 *         return isinstance(obj, self._array_like_types)
 * 
 *     cpdef is_categorical(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_categorical", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_categorical); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":157
 * 
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._categorical_type)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":158
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_categorical_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 158, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":157
 * 
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._categorical_type)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":160
 *             return isinstance(obj, self._categorical_type)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_datetimetz(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":156
 *         return isinstance(obj, self._array_like_types)
 * 
 *     cpdef is_categorical(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_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.lib._PandasAPIShim.is_categorical", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_10is_categorical[] = "_PandasAPIShim.is_categorical(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_categorical (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_categorical(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_categorical", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_categorical", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":162
 *             return False
 * 
 *     cpdef is_datetimetz(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_datetimetz", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_datetimetz); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":163
 * 
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":164
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_datetimetz_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 164, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":163
 * 
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":166
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_sparse(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":162
 *             return False
 * 
 *     cpdef is_datetimetz(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_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.lib._PandasAPIShim.is_datetimetz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz[] = "_PandasAPIShim.is_datetimetz(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_datetimetz (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_datetimetz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_datetimetz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":168
 *             return False
 * 
 *     cpdef is_sparse(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return self._types_api.is_sparse(obj)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_sparse(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_sparse", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_sparse)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":169
 * 
 *     cpdef is_sparse(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return self._types_api.is_sparse(obj)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":170
 *     cpdef is_sparse(self, obj):
 *         if self._have_pandas_internal():
 *             return self._types_api.is_sparse(obj)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_types_api, __pyx_n_s_is_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 170, __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/pandas-shim.pxi":169
 * 
 *     cpdef is_sparse(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return self._types_api.is_sparse(obj)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":172
 *             return self._types_api.is_sparse(obj)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_data_frame(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":168
 *             return False
 * 
 *     cpdef is_sparse(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return self._types_api.is_sparse(obj)
 */

  /* 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.lib._PandasAPIShim.is_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_sparse(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_14is_sparse[] = "_PandasAPIShim.is_sparse(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_sparse(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sparse (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_sparse(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_sparse", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":174
 *             return False
 * 
 *     cpdef is_data_frame(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_data_frame", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_data_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_data_frame)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":175
 * 
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._data_frame)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":176
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_data_frame;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 176, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":175
 * 
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._data_frame)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":178
 *             return isinstance(obj, self._data_frame)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_series(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":174
 *             return False
 * 
 *     cpdef is_data_frame(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)
 */

  /* 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.lib._PandasAPIShim.is_data_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_16is_data_frame[] = "_PandasAPIShim.is_data_frame(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_data_frame (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_data_frame(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_data_frame", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_data_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":180
 *             return False
 * 
 *     cpdef is_series(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_series", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_series)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":181
 * 
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._series)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":182
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_series;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 182, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":181
 * 
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._series)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":184
 *             return isinstance(obj, self._series)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def assert_frame_equal(self, *args, **kwargs):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":180
 *             return False
 * 
 *     cpdef is_series(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)
 */

  /* 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.lib._PandasAPIShim.is_series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_18is_series[] = "_PandasAPIShim.is_series(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_series (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18is_series(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_series", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":186
 *             return False
 * 
 *     def assert_frame_equal(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21assert_frame_equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_20assert_frame_equal[] = "_PandasAPIShim.assert_frame_equal(self, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21assert_frame_equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_frame_equal (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_frame_equal", 1))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20assert_frame_equal(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20assert_frame_equal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_frame_equal", 0);

  /* "pyarrow/pandas-shim.pxi":187
 * 
 *     def assert_frame_equal(self, *args, **kwargs):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._pd.util.testing.assert_frame_equal
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":188
 *     def assert_frame_equal(self, *args, **kwargs):
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal             # <<<<<<<<<<<<<<
 * 
 *     def get_rangeindex_attribute(self, level, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_pd, __pyx_n_s_util); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_testing); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_assert_frame_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 188, __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/pandas-shim.pxi":186
 *             return False
 * 
 *     def assert_frame_equal(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal
 */

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

/* "pyarrow/pandas-shim.pxi":190
 *         return self._pd.util.testing.assert_frame_equal
 * 
 *     def get_rangeindex_attribute(self, level, name):             # <<<<<<<<<<<<<<
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23get_rangeindex_attribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_22get_rangeindex_attribute[] = "_PandasAPIShim.get_rangeindex_attribute(self, level, name)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23get_rangeindex_attribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_level = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_rangeindex_attribute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_rangeindex_attribute", 1, 2, 2, 1); __PYX_ERR(3, 190, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_rangeindex_attribute") < 0)) __PYX_ERR(3, 190, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_level = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_rangeindex_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 190, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.get_rangeindex_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22get_rangeindex_attribute(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_level, __pyx_v_name);

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22get_rangeindex_attribute(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_rangeindex_attribute", 0);

  /* "pyarrow/pandas-shim.pxi":192
 *     def get_rangeindex_attribute(self, level, name):
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         if hasattr(level, name):
 *             return getattr(level, name)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":193
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 *         if hasattr(level, name):             # <<<<<<<<<<<<<<
 *             return getattr(level, name)
 *         return getattr(level, '_' + name)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_level, __pyx_v_name); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 193, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/pandas-shim.pxi":194
 *         self._check_import()
 *         if hasattr(level, name):
 *             return getattr(level, name)             # <<<<<<<<<<<<<<
 *         return getattr(level, '_' + name)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetAttr(__pyx_v_level, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":193
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 *         if hasattr(level, name):             # <<<<<<<<<<<<<<
 *             return getattr(level, name)
 *         return getattr(level, '_' + name)
 */
  }

  /* "pyarrow/pandas-shim.pxi":195
 *         if hasattr(level, name):
 *             return getattr(level, name)
 *         return getattr(level, '_' + name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Add(__pyx_n_u__3, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetAttr(__pyx_v_level, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":190
 *         return self._pd.util.testing.assert_frame_equal
 * 
 *     def get_rangeindex_attribute(self, level, name):             # <<<<<<<<<<<<<<
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.get_rangeindex_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":30
 * 
 *     cdef readonly:
 *         object _loose_version, _version             # <<<<<<<<<<<<<<
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_loose_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_loose_version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __pyx_r = __pyx_v_self->_loose_version;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_8_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_8_version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_version);
  __pyx_r = __pyx_v_self->_version;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":31
 *     cdef readonly:
 *         object _loose_version, _version
 *         object _pd, _types_api, _compat_module             # <<<<<<<<<<<<<<
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type, _extension_array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3_pd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3_pd_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __pyx_r = __pyx_v_self->_pd;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10_types_api_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10_types_api_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_types_api);
  __pyx_r = __pyx_v_self->_types_api;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_compat_module_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_compat_module_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __pyx_r = __pyx_v_self->_compat_module;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":32
 *         object _loose_version, _version
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type             # <<<<<<<<<<<<<<
 *         object _datetimetz_type, _extension_array
 *         object _array_like_types
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11_data_frame_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11_data_frame_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_data_frame);
  __pyx_r = __pyx_v_self->_data_frame;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_index_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_index_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_index);
  __pyx_r = __pyx_v_self->_index;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7_series_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7_series_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_series);
  __pyx_r = __pyx_v_self->_series;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __pyx_r = __pyx_v_self->_categorical_type;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":33
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type, _extension_array             # <<<<<<<<<<<<<<
 *         object _array_like_types
 *         bint has_sparse
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __pyx_r = __pyx_v_self->_datetimetz_type;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_array_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_array_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_array___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_array___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_extension_array);
  __pyx_r = __pyx_v_self->_extension_array;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":34
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type, _extension_array
 *         object _array_like_types             # <<<<<<<<<<<<<<
 *         bint has_sparse
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_array_like_types);
  __pyx_r = __pyx_v_self->_array_like_types;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":35
 *         object _datetimetz_type, _extension_array
 *         object _array_like_types
 *         bint has_sparse             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10has_sparse_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10has_sparse_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10has_sparse___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10has_sparse___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->has_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.has_sparse.__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):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_24__reduce_cython__[] = "_PandasAPIShim.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_24__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_24__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_have_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_tried_importing_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->has_sparse); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(15); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->_array_like_types);
  __Pyx_GIVEREF(__pyx_v_self->_array_like_types);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_array_like_types);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_categorical_type);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __Pyx_GIVEREF(__pyx_v_self->_compat_module);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_compat_module);
  __Pyx_INCREF(__pyx_v_self->_data_frame);
  __Pyx_GIVEREF(__pyx_v_self->_data_frame);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_self->_data_frame);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __Pyx_GIVEREF(__pyx_v_self->_datetimetz_type);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->_datetimetz_type);
  __Pyx_INCREF(__pyx_v_self->_extension_array);
  __Pyx_GIVEREF(__pyx_v_self->_extension_array);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_self->_extension_array);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_index);
  __Pyx_GIVEREF(__pyx_v_self->_index);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_v_self->_index);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __Pyx_GIVEREF(__pyx_v_self->_loose_version);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_v_self->_loose_version);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __Pyx_GIVEREF(__pyx_v_self->_pd);
  PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_v_self->_pd);
  __Pyx_INCREF(__pyx_v_self->_series);
  __Pyx_GIVEREF(__pyx_v_self->_series);
  PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_v_self->_series);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 11, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_types_api);
  __Pyx_GIVEREF(__pyx_v_self->_types_api);
  PyTuple_SET_ITEM(__pyx_t_4, 12, __pyx_v_self->_types_api);
  __Pyx_INCREF(__pyx_v_self->_version);
  __Pyx_GIVEREF(__pyx_v_self->_version);
  PyTuple_SET_ITEM(__pyx_t_4, 13, __pyx_v_self->_version);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 14, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v__dict = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "(tree fragment)":7
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_5 = (__pyx_v__dict != Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, None), state
 */
  /*else*/ {
    __pyx_t_5 = (__pyx_v_self->_array_like_types != Py_None);
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->_categorical_type != Py_None);
    __pyx_t_5 = (__pyx_t_7 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_compat_module != Py_None);
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->_data_frame != Py_None);
    __pyx_t_5 = (__pyx_t_7 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_datetimetz_type != Py_None);
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->_extension_array != Py_None);
    __pyx_t_5 = (__pyx_t_7 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_index != Py_None);
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->_loose_version != Py_None);
    __pyx_t_5 = (__pyx_t_7 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_pd != Py_None);
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->_series != Py_None);
    __pyx_t_5 = (__pyx_t_7 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->_types_api != Py_None);
    __pyx_t_7 = (__pyx_t_5 != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->_version != Py_None);
    __pyx_t_5 = (__pyx_t_7 != 0);
    __pyx_t_6 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_6;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, None), state
 *     else:
 */
  __pyx_t_6 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":13
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle__PandasAPIShim); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_261329190);
    __Pyx_GIVEREF(__pyx_int_261329190);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_261329190);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, None), state
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle__PandasAPIShim); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_261329190);
    __Pyx_GIVEREF(__pyx_int_261329190);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_261329190);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.__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__PandasAPIShim, (type(self), 0xf939126, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_26__setstate_cython__[] = "_PandasAPIShim.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_26__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0xf939126, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */

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

/* "pyarrow/error.pxi":40
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ArrowKeyError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ArrowKeyError___str__[] = "ArrowKeyError.__str__(self)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13ArrowKeyError_1__str__ = {"__str__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13ArrowKeyError_1__str__, METH_O, __pyx_doc_7pyarrow_3lib_13ArrowKeyError___str__};
static PyObject *__pyx_pw_7pyarrow_3lib_13ArrowKeyError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ArrowKeyError___str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13ArrowKeyError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/error.pxi":42
 *     def __str__(self):
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/error.pxi":40
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */

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

/* "pyarrow/error.pxi":67
 * # This function could be written directly in C++ if we didn't
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:             # <<<<<<<<<<<<<<
 *     if status.ok():
 *         return 0
 */

static int __pyx_f_7pyarrow_3lib_check_status(arrow::Status const &__pyx_v_status) {
  PyObject *__pyx_v_message = 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;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_RefNannySetupContext("check_status", 1);

  /* "pyarrow/error.pxi":68
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  /*try:*/ {
    __pyx_t_1 = (__pyx_v_status.ok() != 0);
    if (__pyx_t_1) {

      /* "pyarrow/error.pxi":69
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     with gil:
 */
      __pyx_r = 0;
      goto __pyx_L3_return;

      /* "pyarrow/error.pxi":68
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    }

    /* "pyarrow/error.pxi":71
 *         return 0
 * 
 *     with gil:             # <<<<<<<<<<<<<<
 *         if IsPyError(status):
 *             RestorePyError(status)
 */
    {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        #endif
        /*try:*/ {

          /* "pyarrow/error.pxi":72
 * 
 *     with gil:
 *         if IsPyError(status):             # <<<<<<<<<<<<<<
 *             RestorePyError(status)
 *             return -1
 */
          __pyx_t_1 = (arrow::py::IsPyError(__pyx_v_status) != 0);
          if (__pyx_t_1) {

            /* "pyarrow/error.pxi":73
 *     with gil:
 *         if IsPyError(status):
 *             RestorePyError(status)             # <<<<<<<<<<<<<<
 *             return -1
 * 
 */
            arrow::py::RestorePyError(__pyx_v_status);

            /* "pyarrow/error.pxi":74
 *         if IsPyError(status):
 *             RestorePyError(status)
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *         message = frombytes(status.message())
 */
            __pyx_r = -1;
            goto __pyx_L7_return;

            /* "pyarrow/error.pxi":72
 * 
 *     with gil:
 *         if IsPyError(status):             # <<<<<<<<<<<<<<
 *             RestorePyError(status)
 *             return -1
 */
          }

          /* "pyarrow/error.pxi":76
 *             return -1
 * 
 *         message = frombytes(status.message())             # <<<<<<<<<<<<<<
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_status.message()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_message = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "pyarrow/error.pxi":77
 * 
 *         message = frombytes(status.message())
 *         if status.IsInvalid():             # <<<<<<<<<<<<<<
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():
 */
          __pyx_t_1 = (__pyx_v_status.IsInvalid() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":78
 *         message = frombytes(status.message())
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)             # <<<<<<<<<<<<<<
 *         elif status.IsIOError():
 *             raise ArrowIOError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowInvalid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 78, __pyx_L8_error)

            /* "pyarrow/error.pxi":77
 * 
 *         message = frombytes(status.message())
 *         if status.IsInvalid():             # <<<<<<<<<<<<<<
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():
 */
          }

          /* "pyarrow/error.pxi":79
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():             # <<<<<<<<<<<<<<
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():
 */
          __pyx_t_1 = (__pyx_v_status.IsIOError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":80
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():
 *             raise ArrowIOError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 80, __pyx_L8_error)

            /* "pyarrow/error.pxi":79
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():             # <<<<<<<<<<<<<<
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():
 */
          }

          /* "pyarrow/error.pxi":81
 *         elif status.IsIOError():
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():             # <<<<<<<<<<<<<<
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 */
          __pyx_t_1 = (__pyx_v_status.IsOutOfMemory() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":82
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowMemoryError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 82, __pyx_L8_error)

            /* "pyarrow/error.pxi":81
 *         elif status.IsIOError():
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():             # <<<<<<<<<<<<<<
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 */
          }

          /* "pyarrow/error.pxi":83
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():             # <<<<<<<<<<<<<<
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 */
          __pyx_t_1 = (__pyx_v_status.IsKeyError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":84
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowKeyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 84, __pyx_L8_error)

            /* "pyarrow/error.pxi":83
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():             # <<<<<<<<<<<<<<
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 */
          }

          /* "pyarrow/error.pxi":85
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():             # <<<<<<<<<<<<<<
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 */
          __pyx_t_1 = (__pyx_v_status.IsNotImplemented() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":86
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowNotImplementedError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 86, __pyx_L8_error)

            /* "pyarrow/error.pxi":85
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():             # <<<<<<<<<<<<<<
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 */
          }

          /* "pyarrow/error.pxi":87
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():             # <<<<<<<<<<<<<<
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 */
          __pyx_t_1 = (__pyx_v_status.IsTypeError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":88
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowTypeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 88, __pyx_L8_error)

            /* "pyarrow/error.pxi":87
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():             # <<<<<<<<<<<<<<
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 */
          }

          /* "pyarrow/error.pxi":89
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():             # <<<<<<<<<<<<<<
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():
 */
          __pyx_t_1 = (__pyx_v_status.IsCapacityError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":90
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowCapacityError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 90, __pyx_L8_error)

            /* "pyarrow/error.pxi":89
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():             # <<<<<<<<<<<<<<
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():
 */
          }

          /* "pyarrow/error.pxi":91
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():             # <<<<<<<<<<<<<<
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():
 */
          __pyx_t_1 = (__pyx_v_status.IsIndexError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":92
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsSerializationError():
 *             raise ArrowSerializationError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 92, __pyx_L8_error)

            /* "pyarrow/error.pxi":91
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():             # <<<<<<<<<<<<<<
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():
 */
          }

          /* "pyarrow/error.pxi":93
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():             # <<<<<<<<<<<<<<
 *             raise ArrowSerializationError(message)
 *         else:
 */
          __pyx_t_1 = (__pyx_v_status.IsSerializationError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":94
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():
 *             raise ArrowSerializationError(message)             # <<<<<<<<<<<<<<
 *         else:
 *             message = frombytes(status.ToString())
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 94, __pyx_L8_error)

            /* "pyarrow/error.pxi":93
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():             # <<<<<<<<<<<<<<
 *             raise ArrowSerializationError(message)
 *         else:
 */
          }

          /* "pyarrow/error.pxi":96
 *             raise ArrowSerializationError(message)
 *         else:
 *             message = frombytes(status.ToString())             # <<<<<<<<<<<<<<
 *             raise ArrowException(message)
 * 
 */
          /*else*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_status.ToString()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "pyarrow/error.pxi":97
 *         else:
 *             message = frombytes(status.ToString())
 *             raise ArrowException(message)             # <<<<<<<<<<<<<<
 * 
 * 
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 97, __pyx_L8_error)
          }
        }

        /* "pyarrow/error.pxi":71
 *         return 0
 * 
 *     with gil:             # <<<<<<<<<<<<<<
 *         if IsPyError(status):
 *             RestorePyError(status)
 */
        /*finally:*/ {
          __pyx_L7_return: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L3_return;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L4_error;
          }
        }
    }
  }

  /* "pyarrow/error.pxi":68
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "pyarrow/error.pxi":67
 * # This function could be written directly in C++ if we didn't
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:             # <<<<<<<<<<<<<<
 *     if status.ok():
 *         return 0
 */

  /* 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_AddTraceback("pyarrow.lib.check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "pyarrow/error.pxi":101
 * 
 * # This is an API function for C++ PyArrow
 * cdef api int pyarrow_internal_check_status(const CStatus& status) \             # <<<<<<<<<<<<<<
 *         nogil except -1:
 *     return check_status(status)
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_internal_check_status(arrow::Status const &__pyx_v_status) {
  int __pyx_r;
  int __pyx_t_1;

  /* "pyarrow/error.pxi":103
 * cdef api int pyarrow_internal_check_status(const CStatus& status) \
 *         nogil except -1:
 *     return check_status(status)             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_status); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 103, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/error.pxi":101
 * 
 * # This is an API function for C++ PyArrow
 * cdef api int pyarrow_internal_check_status(const CStatus& status) \             # <<<<<<<<<<<<<<
 *         nogil except -1:
 *     return check_status(status)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("pyarrow.lib.pyarrow_internal_check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/memory.pxi":31
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 */

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

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

static int __pyx_pf_7pyarrow_3lib_10MemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":34
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, CMemoryPool* pool):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":32
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.*_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(10, 32, __pyx_L1_error)

  /* "pyarrow/memory.pxi":31
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 */

  /* 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.lib.MemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":36
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         self.pool = pool
 * 
 */

static void __pyx_f_7pyarrow_3lib_10MemoryPool_init(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self,  arrow::MemoryPool *__pyx_v_pool) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/memory.pxi":37
 * 
 *     cdef void init(self, CMemoryPool* pool):
 *         self.pool = pool             # <<<<<<<<<<<<<<
 * 
 *     def bytes_allocated(self):
 */
  __pyx_v_self->pool = __pyx_v_pool;

  /* "pyarrow/memory.pxi":36
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         self.pool = pool
 * 
 */

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

/* "pyarrow/memory.pxi":39
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of bytes that are currently allocated from this
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_2bytes_allocated[] = "MemoryPool.bytes_allocated(self)\n\n        Return the number of bytes that are currently allocated from this\n        memory pool.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bytes_allocated (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("bytes_allocated", 0);

  /* "pyarrow/memory.pxi":44
 *         memory pool.
 *         """
 *         return self.pool.bytes_allocated()             # <<<<<<<<<<<<<<
 * 
 *     def max_memory(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->pool->bytes_allocated()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":39
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of bytes that are currently allocated from this
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.bytes_allocated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":46
 *         return self.pool.bytes_allocated()
 * 
 *     def max_memory(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the peak memory allocation in this memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_4max_memory[] = "MemoryPool.max_memory(self)\n\n        Return the peak memory allocation in this memory pool.\n        This can be an approximate number in multi-threaded applications.\n\n        None is returned if the pool implementation doesn't know how to\n        compute this number.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max_memory (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  int64_t __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("max_memory", 0);

  /* "pyarrow/memory.pxi":54
 *         compute this number.
 *         """
 *         ret = self.pool.max_memory()             # <<<<<<<<<<<<<<
 *         return ret if ret >= 0 else None
 * 
 */
  __pyx_v_ret = __pyx_v_self->pool->max_memory();

  /* "pyarrow/memory.pxi":55
 *         """
 *         ret = self.pool.max_memory()
 *         return ret if ret >= 0 else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_ret >= 0) != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":46
 *         return self.pool.bytes_allocated()
 * 
 *     def max_memory(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the peak memory allocation in this memory pool.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.max_memory", __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.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_6__reduce_cython__[] = "MemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_8__setstate_cython__[] = "MemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/memory.pxi":58
 * 
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):             # <<<<<<<<<<<<<<
 *     if memory_pool is None:
 *         return c_get_memory_pool()
 */

static  arrow::MemoryPool *__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("maybe_unbox_memory_pool", 0);

  /* "pyarrow/memory.pxi":59
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:             # <<<<<<<<<<<<<<
 *         return c_get_memory_pool()
 *     else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_memory_pool) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/memory.pxi":60
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:
 *         return c_get_memory_pool()             # <<<<<<<<<<<<<<
 *     else:
 *         return memory_pool.pool
 */
    __pyx_r =  arrow::py::get_memory_pool();
    goto __pyx_L0;

    /* "pyarrow/memory.pxi":59
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:             # <<<<<<<<<<<<<<
 *         return c_get_memory_pool()
 *     else:
 */
  }

  /* "pyarrow/memory.pxi":62
 *         return c_get_memory_pool()
 *     else:
 *         return memory_pool.pool             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = __pyx_v_memory_pool->pool;
    goto __pyx_L0;
  }

  /* "pyarrow/memory.pxi":58
 * 
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):             # <<<<<<<<<<<<<<
 *     if memory_pool is None:
 *         return c_get_memory_pool()
 */

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

/* "pyarrow/memory.pxi":69
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 */

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

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

static int __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":72
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_2, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":70
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.logging_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(10, 70, __pyx_L1_error)

  /* "pyarrow/memory.pxi":69
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 */

  /* 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.lib.LoggingMemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__[] = "LoggingMemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__[] = "LoggingMemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/memory.pxi":84
 *         unique_ptr[CProxyMemoryPool] proxy_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 */

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

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

static int __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":87
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_3, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":85
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.proxy_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(10, 85, __pyx_L1_error)

  /* "pyarrow/memory.pxi":84
 *         unique_ptr[CProxyMemoryPool] proxy_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 */

  /* 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.lib.ProxyMemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__[] = "ProxyMemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__[] = "ProxyMemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5default_memory_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_4default_memory_pool[] = "default_memory_pool()\n\n    Return the process-global memory pool.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5default_memory_pool = {"default_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_5default_memory_pool, METH_NOARGS, __pyx_doc_7pyarrow_3lib_4default_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_5default_memory_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_memory_pool (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_4default_memory_pool(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_4default_memory_pool(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("default_memory_pool", 0);

  /* "pyarrow/memory.pxi":95
 *     """
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)             # <<<<<<<<<<<<<<
 *     pool.init(c_get_memory_pool())
 *     return pool
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_MemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_MemoryPool), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 95, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":96
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 *     pool.init(c_get_memory_pool())             # <<<<<<<<<<<<<<
 *     return pool
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *)__pyx_v_pool->__pyx_vtab)->init(__pyx_v_pool,  arrow::py::get_memory_pool());

  /* "pyarrow/memory.pxi":97
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 *     pool.init(c_get_memory_pool())
 *     return pool             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_pool));
  __pyx_r = ((PyObject *)__pyx_v_pool);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */

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

/* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7proxy_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6proxy_memory_pool[] = "proxy_memory_pool(MemoryPool parent)\n\n    Create and return a MemoryPool instance that redirects to the\n    *parent*, but with separate allocation statistics.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_7proxy_memory_pool = {"proxy_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_7proxy_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_6proxy_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_7proxy_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("proxy_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "parent", 0))) __PYX_ERR(10, 100, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6proxy_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_parent));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6proxy_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("proxy_memory_pool", 0);

  /* "pyarrow/memory.pxi":105
 *     *parent*, but with separate allocation statistics.
 *     """
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)             # <<<<<<<<<<<<<<
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ProxyMemoryPool), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 105, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":106
 *     """
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))             # <<<<<<<<<<<<<<
 *     out.init(out.proxy_pool.get())
 *     return out
 */
  __pyx_v_out->proxy_pool.reset(new  arrow::ProxyMemoryPool(__pyx_v_parent->pool));

  /* "pyarrow/memory.pxi":107
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_out), __pyx_v_out->proxy_pool.get());

  /* "pyarrow/memory.pxi":108
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

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

/* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9logging_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8logging_memory_pool[] = "logging_memory_pool(MemoryPool parent)\n\n    Create and return a MemoryPool instance that redirects to the\n    *parent*, but also dumps allocation logs on stderr.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_9logging_memory_pool = {"logging_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_9logging_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_8logging_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_9logging_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("logging_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "parent", 0))) __PYX_ERR(10, 111, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_8logging_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_parent));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8logging_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("logging_memory_pool", 0);

  /* "pyarrow/memory.pxi":116
 *     *parent*, but also dumps allocation logs on stderr.
 *     """
 *     cdef LoggingMemoryPool out = LoggingMemoryPool.__new__(             # <<<<<<<<<<<<<<
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_parent));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_parent));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_parent));
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LoggingMemoryPool), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 116, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":118
 *     cdef LoggingMemoryPool out = LoggingMemoryPool.__new__(
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))             # <<<<<<<<<<<<<<
 *     out.init(out.logging_pool.get())
 *     return out
 */
  __pyx_v_out->logging_pool.reset(new  arrow::LoggingMemoryPool(__pyx_v_parent->pool));

  /* "pyarrow/memory.pxi":119
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 *     out.init(out.logging_pool.get())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_out), __pyx_v_out->logging_pool.get());

  /* "pyarrow/memory.pxi":120
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 *     out.init(out.logging_pool.get())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.logging_memory_pool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11set_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_pool); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10set_memory_pool[] = "set_memory_pool(MemoryPool pool)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11set_memory_pool = {"set_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_11set_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_10set_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_11set_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_pool) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(10, 123, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10set_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_pool));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10set_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memory_pool", 0);

  /* "pyarrow/memory.pxi":124
 * 
 * def set_memory_pool(MemoryPool pool):
 *     c_set_default_memory_pool(pool.pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
   arrow::py::set_default_memory_pool(__pyx_v_pool->pool);

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13log_memory_allocations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12log_memory_allocations[] = "log_memory_allocations(enable=True)\n\n    Enable or disable memory allocator logging for debugging purposes\n\n    Parameters\n    ----------\n    enable : boolean, default True\n        Pass False to disable logging\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13log_memory_allocations = {"log_memory_allocations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13log_memory_allocations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12log_memory_allocations};
static PyObject *__pyx_pw_7pyarrow_3lib_13log_memory_allocations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_enable = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("log_memory_allocations (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_enable,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log_memory_allocations") < 0)) __PYX_ERR(10, 132, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_enable = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("log_memory_allocations", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 132, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.log_memory_allocations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12log_memory_allocations(__pyx_self, __pyx_v_enable);

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

static PyObject *__pyx_pf_7pyarrow_3lib_12log_memory_allocations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enable) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("log_memory_allocations", 0);

  /* "pyarrow/memory.pxi":141
 *         Pass False to disable logging
 *     """
 *     if enable:             # <<<<<<<<<<<<<<
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_enable); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(10, 141, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/memory.pxi":142
 *     """
 *     if enable:
 *         set_memory_pool(_logging_memory_pool)             # <<<<<<<<<<<<<<
 *     else:
 *         set_memory_pool(_default_memory_pool)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_set_memory_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/memory.pxi":141
 *         Pass False to disable logging
 *     """
 *     if enable:             # <<<<<<<<<<<<<<
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/memory.pxi":144
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 *         set_memory_pool(_default_memory_pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_set_memory_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */

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

/* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15total_allocated_bytes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14total_allocated_bytes[] = "total_allocated_bytes()\n\n    Return the currently allocated bytes from the default memory pool.\n    Other memory pools may not be accounted for.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15total_allocated_bytes = {"total_allocated_bytes", (PyCFunction)__pyx_pw_7pyarrow_3lib_15total_allocated_bytes, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14total_allocated_bytes};
static PyObject *__pyx_pw_7pyarrow_3lib_15total_allocated_bytes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("total_allocated_bytes (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14total_allocated_bytes(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_14total_allocated_bytes(CYTHON_UNUSED PyObject *__pyx_self) {
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("total_allocated_bytes", 0);

  /* "pyarrow/memory.pxi":152
 *     Other memory pools may not be accounted for.
 *     """
 *     cdef CMemoryPool* pool = c_get_memory_pool()             # <<<<<<<<<<<<<<
 *     return pool.bytes_allocated()
 * 
 */
  __pyx_v_pool =  arrow::py::get_memory_pool();

  /* "pyarrow/memory.pxi":153
 *     """
 *     cdef CMemoryPool* pool = c_get_memory_pool()
 *     return pool.bytes_allocated()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_pool->bytes_allocated()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */

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

/* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17jemalloc_set_decay_ms(PyObject *__pyx_self, PyObject *__pyx_v_decay_ms); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16jemalloc_set_decay_ms[] = "jemalloc_set_decay_ms(decay_ms)\n\n    Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of\n    milliseconds. A value of 0 (the default) results in dirty / muzzy memory\n    pages being released right away to the OS, while a higher value will result\n    in a time-based decay. See the jemalloc docs for more information\n\n    It's best to set this at the start of your application.\n\n    Parameters\n    ----------\n    decay_ms : int\n        Number of milliseconds to set for jemalloc decay conf parameters. Note\n        that this change will only affect future memory arenas\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_17jemalloc_set_decay_ms = {"jemalloc_set_decay_ms", (PyCFunction)__pyx_pw_7pyarrow_3lib_17jemalloc_set_decay_ms, METH_O, __pyx_doc_7pyarrow_3lib_16jemalloc_set_decay_ms};
static PyObject *__pyx_pw_7pyarrow_3lib_17jemalloc_set_decay_ms(PyObject *__pyx_self, PyObject *__pyx_v_decay_ms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("jemalloc_set_decay_ms (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16jemalloc_set_decay_ms(__pyx_self, ((PyObject *)__pyx_v_decay_ms));

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

static PyObject *__pyx_pf_7pyarrow_3lib_16jemalloc_set_decay_ms(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_decay_ms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("jemalloc_set_decay_ms", 0);

  /* "pyarrow/memory.pxi":171
 *         that this change will only affect future memory arenas
 *     """
 *     check_status(c_jemalloc_set_decay_ms(decay_ms))             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_decay_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 171, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::jemalloc_set_decay_ms(__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 171, __pyx_L1_error)

  /* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.jemalloc_set_decay_ms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":67
 * 
 * 
 * cdef bytes _datatype_to_pep3118(CDataType* type):             # <<<<<<<<<<<<<<
 *     """
 *     Construct a PEP 3118 format string describing the given datatype.
 */

static PyObject *__pyx_f_7pyarrow_3lib__datatype_to_pep3118( arrow::DataType *__pyx_v_type) {
  PyObject *__pyx_v_char = 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;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_datatype_to_pep3118", 0);

  /* "pyarrow/types.pxi":72
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
  {
    __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/types.pxi":73
 *     """
 *     try:
 *         char = _pep3118_type_map[type.id()]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         return None
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__pep3118_type_map == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 73, __pyx_L3_error)
      }
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type->id()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 73, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pep3118_type_map, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 73, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_char = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/types.pxi":72
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
    }

    /* "pyarrow/types.pxi":77
 *         return None
 *     else:
 *         if char in b'bBhHiIqQ':             # <<<<<<<<<<<<<<
 *             # Use "standard" int widths, not native
 *             return b'=' + char
 */
    /*else:*/ {
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_char, __pyx_n_b_bBhHiIqQ, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 77, __pyx_L5_except_error)
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "pyarrow/types.pxi":79
 *         if char in b'bBhHiIqQ':
 *             # Use "standard" int widths, not native
 *             return b'=' + char             # <<<<<<<<<<<<<<
 *         else:
 *             return char
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = PyNumber_Add(__pyx_kp_b__10, __pyx_v_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 79, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(4, 79, __pyx_L5_except_error)
        __pyx_r = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;
        goto __pyx_L6_except_return;

        /* "pyarrow/types.pxi":77
 *         return None
 *     else:
 *         if char in b'bBhHiIqQ':             # <<<<<<<<<<<<<<
 *             # Use "standard" int widths, not native
 *             return b'=' + char
 */
      }

      /* "pyarrow/types.pxi":81
 *             return b'=' + char
 *         else:
 *             return char             # <<<<<<<<<<<<<<
 * 
 * 
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (!(likely(PyBytes_CheckExact(__pyx_v_char))||((__pyx_v_char) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_char)->tp_name), 0))) __PYX_ERR(4, 81, __pyx_L5_except_error)
        __Pyx_INCREF(__pyx_v_char);
        __pyx_r = ((PyObject*)__pyx_v_char);
        goto __pyx_L6_except_return;
      }
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/types.pxi":74
 *     try:
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib._datatype_to_pep3118", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_9) < 0) __PYX_ERR(4, 74, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_9);

      /* "pyarrow/types.pxi":75
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         if char in b'bBhHiIqQ':
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":72
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
    __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;
  }

  /* "pyarrow/types.pxi":67
 * 
 * 
 * cdef bytes _datatype_to_pep3118(CDataType* type):             # <<<<<<<<<<<<<<
 *     """
 *     Construct a PEP 3118 format string describing the given datatype.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib._datatype_to_pep3118", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_char);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":84
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_is_primitive(PyObject *__pyx_self, PyObject *__pyx_arg_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_is_primitive[] = "_is_primitive(Type type)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_19_is_primitive = {"_is_primitive", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_is_primitive, METH_O, __pyx_doc_7pyarrow_3lib_18_is_primitive};
static PyObject *__pyx_pw_7pyarrow_3lib_19_is_primitive(PyObject *__pyx_self, PyObject *__pyx_arg_type) {
  enum  arrow::Type::type __pyx_v_type;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_primitive (wrapper)", 0);
  assert(__pyx_arg_type); {
    __pyx_v_type = ((enum  arrow::Type::type)__Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_arg_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 84, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._is_primitive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_is_primitive(__pyx_self, ((enum  arrow::Type::type)__pyx_v_type));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_is_primitive(CYTHON_UNUSED PyObject *__pyx_self, enum  arrow::Type::type __pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_is_primitive", 0);

  /* "pyarrow/types.pxi":86
 * def _is_primitive(Type type):
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::is_primitive(__pyx_v_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":84
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */

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

/* "pyarrow/types.pxi":100
 *     Each data type is an *instance* of this class.
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

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

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

static int __pyx_pf_7pyarrow_3lib_8DataType___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

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

/* "pyarrow/types.pxi":103
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use public "
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 */

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

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

static int __pyx_pf_7pyarrow_3lib_8DataType_2__init__(struct __pyx_obj_7pyarrow_3lib_DataType *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":106
 *         raise TypeError("Do not call {}'s constructor directly, use public "
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 *                         "instead.".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_4, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":104
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use public "             # <<<<<<<<<<<<<<
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 *                         "instead.".format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(4, 104, __pyx_L1_error)

  /* "pyarrow/types.pxi":103
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use public "
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 */

  /* 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.lib.DataType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":108
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         assert type != nullptr
 *         self.sp_type = type
 */

static void __pyx_f_7pyarrow_3lib_8DataType_init(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":109
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         assert type != nullptr             # <<<<<<<<<<<<<<
 *         self.sp_type = type
 *         self.type = type.get()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_type != nullptr) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(4, 109, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":110
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         assert type != nullptr
 *         self.sp_type = type             # <<<<<<<<<<<<<<
 *         self.type = type.get()
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 */
  __pyx_v_self->sp_type = __pyx_v_type;

  /* "pyarrow/types.pxi":111
 *         assert type != nullptr
 *         self.sp_type = type
 *         self.type = type.get()             # <<<<<<<<<<<<<<
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 */
  __pyx_v_self->type = __pyx_v_type.get();

  /* "pyarrow/types.pxi":112
 *         self.sp_type = type
 *         self.type = type.get()
 *         self.pep3118_format = _datatype_to_pep3118(self.type)             # <<<<<<<<<<<<<<
 * 
 *     cdef Field child(self, int i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datatype_to_pep3118(__pyx_v_self->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pep3118_format);
  __Pyx_DECREF(__pyx_v_self->pep3118_format);
  __pyx_v_self->pep3118_format = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":108
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         assert type != nullptr
 *         self.sp_type = type
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":114
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 *     cdef Field child(self, int i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_8DataType_child(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_index;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("child", 0);

  /* "pyarrow/types.pxi":115
 * 
 *     cdef Field child(self, int i):
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.type.child(index))
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_v_self->type->num_children()); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(4, 115, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_1);

  /* "pyarrow/types.pxi":116
 *     cdef Field child(self, int i):
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->type->child(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 116, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":114
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 *     cdef Field child(self, int i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.DataType.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":119
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         return self.type.id()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_2id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_2id___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_2id___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":120
 *     @property
 *     def id(self):
 *         return self.type.id()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_self->type->id()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":119
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         return self.type.id()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":123
 * 
 *     @property
 *     def bit_width(self):             # <<<<<<<<<<<<<<
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9bit_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9bit_width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_9bit_width___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_9bit_width___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  __pyx_t_7pyarrow_3lib__CFixedWidthTypePtr __pyx_v_ty;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7pyarrow_3lib__CFixedWidthTypePtr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":125
 *     def bit_width(self):
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)             # <<<<<<<<<<<<<<
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")
 */
  try {
    __pyx_t_1 = dynamic_cast<__pyx_t_7pyarrow_3lib__CFixedWidthTypePtr>(__pyx_v_self->type);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(4, 125, __pyx_L1_error)
  }
  __pyx_v_ty = __pyx_t_1;

  /* "pyarrow/types.pxi":126
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("Non-fixed width type")
 *         return ty.bit_width()
 */
  __pyx_t_2 = ((__pyx_v_ty == nullptr) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":127
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")             # <<<<<<<<<<<<<<
 *         return ty.bit_width()
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 127, __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(4, 127, __pyx_L1_error)

    /* "pyarrow/types.pxi":126
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("Non-fixed width type")
 *         return ty.bit_width()
 */
  }

  /* "pyarrow/types.pxi":128
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")
 *         return ty.bit_width()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ty->bit_width()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":123
 * 
 *     @property
 *     def bit_width(self):             # <<<<<<<<<<<<<<
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DataType.bit_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":131
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of child fields.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_12num_children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_12num_children_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_12num_children___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12num_children___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":135
 *         The number of child fields.
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->type->num_children()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":131
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of child fields.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.num_children.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":138
 * 
 *     @property
 *     def num_buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of data buffers required to construct Array type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11num_buffers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11num_buffers_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_11num_buffers___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_11num_buffers___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":143
 *         excluding children
 *         """
 *         return self.type.layout().bit_widths.size()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->type->layout().bit_widths.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":138
 * 
 *     @property
 *     def num_buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of data buffers required to construct Array type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.num_buffers.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":145
 *         return self.type.layout().bit_widths.size()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.type.ToString())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_4__str__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":146
 * 
 *     def __str__(self):
 *         return frombytes(self.type.ToString())             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->type->ToString()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(4, 146, __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/types.pxi":145
 *         return self.type.layout().bit_widths.size()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.type.ToString())
 * 
 */

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

/* "pyarrow/types.pxi":148
 *         return frombytes(self.type.ToString())
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(str(self))
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_8DataType_7__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_8DataType_7__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_6__hash__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static Py_hash_t __pyx_pf_7pyarrow_3lib_8DataType_6__hash__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_hash_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/types.pxi":149
 * 
 *     def __hash__(self):
 *         return hash(str(self))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(4, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":148
 *         return frombytes(self.type.ToString())
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(str(self))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":151
 *         return hash(str(self))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type_for_alias, (str(self),)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8DataType_8__reduce__[] = "DataType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_8__reduce__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_8__reduce__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":152
 * 
 *     def __reduce__(self):
 *         return type_for_alias, (str(self),)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":151
 *         return hash(str(self))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type_for_alias, (str(self),)
 * 
 */

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

/* "pyarrow/types.pxi":154
 *         return type_for_alias, (str(self),)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_10__repr__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_10__repr__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/types.pxi":155
 * 
 *     def __repr__(self):
 *         return '{0.__class__.__name__}({0})'.format(self)             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0___class_____name___0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 155, __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/types.pxi":154
 *         return type_for_alias, (str(self),)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 */

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

/* "pyarrow/types.pxi":157
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_13__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_13__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_12__eq__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12__eq__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":158
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
  {
    __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/types.pxi":159
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except (TypeError, ValueError):
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 159, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 159, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/types.pxi":158
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
    }
    __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;

    /* "pyarrow/types.pxi":160
 *         try:
 *             return self.equals(other)
 *         except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.DataType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 160, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":161
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":158
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":157
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":163
 *             return NotImplemented
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if type is equivalent to passed value
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_15equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8DataType_14equals[] = "DataType.equals(self, other)\n\n        Return true if type is equivalent to passed value\n\n        Parameters\n        ----------\n        other : DataType or string convertible to DataType\n\n        Returns\n        -------\n        is_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_15equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_14equals(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_14equals(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_other_type = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/types.pxi":177
 *         cdef DataType other_type
 * 
 *         if not isinstance(other, DataType):             # <<<<<<<<<<<<<<
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":178
 * 
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):             # <<<<<<<<<<<<<<
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_string_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 178, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":179
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)             # <<<<<<<<<<<<<<
 *             other_type = type_for_alias(other)
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 179, __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(4, 179, __pyx_L1_error)

      /* "pyarrow/types.pxi":178
 * 
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):             # <<<<<<<<<<<<<<
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)
 */
    }

    /* "pyarrow/types.pxi":180
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)             # <<<<<<<<<<<<<<
 *         else:
 *             other_type = other
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 180, __pyx_L1_error)
    __pyx_v_other_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":177
 *         cdef DataType other_type
 * 
 *         if not isinstance(other, DataType):             # <<<<<<<<<<<<<<
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":182
 *             other_type = type_for_alias(other)
 *         else:
 *             other_type = other             # <<<<<<<<<<<<<<
 * 
 *         return self.type.Equals(deref(other_type.type))
 */
  /*else*/ {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 182, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_other_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":184
 *             other_type = other
 * 
 *         return self.type.Equals(deref(other_type.type))             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas_dtype(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->type->Equals((*__pyx_v_other_type->type))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":163
 *             return NotImplemented
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if type is equivalent to passed value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.DataType.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_other_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":186
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8DataType_16to_pandas_dtype[] = "DataType.to_pandas_dtype(self)\n\n        Return the equivalent NumPy / Pandas dtype.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  enum  arrow::Type::type __pyx_v_type_id;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_pandas_dtype", 0);

  /* "pyarrow/types.pxi":190
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         cdef Type type_id = self.type.id()             # <<<<<<<<<<<<<<
 *         if type_id in _pandas_type_map:
 *             return _pandas_type_map[type_id]
 */
  __pyx_v_type_id = __pyx_v_self->type->id();

  /* "pyarrow/types.pxi":191
 *         """
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[type_id]
 *         else:
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 191, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_7pyarrow_3lib__pandas_type_map, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/types.pxi":192
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:
 *             return _pandas_type_map[type_id]             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError(str(self))
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 192, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pandas_type_map, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":191
 *         """
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[type_id]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":194
 *             return _pandas_type_map[type_id]
 *         else:
 *             raise NotImplementedError(str(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 194, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":186
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.DataType.to_pandas_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":201
 *     Tracking container for dictionary-encoded fields
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sp_memo.reset(new CDictionaryMemo())
 *         self.memo = self.sp_memo.get()
 */

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

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

static int __pyx_pf_7pyarrow_3lib_14DictionaryMemo___cinit__(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
   arrow::ipc::DictionaryMemo *__pyx_t_1;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":202
 *     """
 *     def __cinit__(self):
 *         self.sp_memo.reset(new CDictionaryMemo())             # <<<<<<<<<<<<<<
 *         self.memo = self.sp_memo.get()
 * 
 */
  try {
    __pyx_t_1 = new  arrow::ipc::DictionaryMemo();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(4, 202, __pyx_L1_error)
  }
  __pyx_v_self->sp_memo.reset(__pyx_t_1);

  /* "pyarrow/types.pxi":203
 *     def __cinit__(self):
 *         self.sp_memo.reset(new CDictionaryMemo())
 *         self.memo = self.sp_memo.get()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->memo = __pyx_v_self->sp_memo.get();

  /* "pyarrow/types.pxi":201
 *     Tracking container for dictionary-encoded fields
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sp_memo.reset(new CDictionaryMemo())
 *         self.memo = self.sp_memo.get()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.DictionaryMemo.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__[] = "DictionaryMemo.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryMemo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__[] = "DictionaryMemo.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

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

/* "pyarrow/types.pxi":211
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.dict_type = <const CDictionaryType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_14DictionaryType_init(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":212
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 212, __pyx_L1_error)

  /* "pyarrow/types.pxi":213
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.dict_type = <const CDictionaryType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->dict_type = (( arrow::DictionaryType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":211
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.dict_type = <const CDictionaryType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":215
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return dictionary, (self.index_type, self.value_type, self.ordered)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14DictionaryType___reduce__[] = "DictionaryType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType___reduce__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":216
 * 
 *     def __reduce__(self):
 *         return dictionary, (self.index_type, self.value_type, self.ordered)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ordered); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":215
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return dictionary, (self.index_type, self.value_type, self.ordered)
 * 
 */

  /* 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.lib.DictionaryType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":219
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the dictionary is ordered, i.e. whether the ordering of values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_7ordered___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_7ordered___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":224
 *         in the dictionary is important.
 *         """
 *         return self.dict_type.ordered()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->dict_type->ordered()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":219
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the dictionary is ordered, i.e. whether the ordering of values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.ordered.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":227
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of dictionary indices (a signed integer type).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_10index_type___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10index_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":231
 *         The data type of dictionary indices (a signed integer type).
 *         """
 *         return pyarrow_wrap_data_type(self.dict_type.index_type())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->dict_type->index_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":227
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of dictionary indices (a signed integer type).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.index_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":234
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The dictionary value type. The dictionary values are found in an
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":239
 *         instance of DictionaryArray
 *         """
 *         return pyarrow_wrap_data_type(self.dict_type.value_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->dict_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":234
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The dictionary value type. The dictionary values are found in an
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.value_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":247
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CListType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_8ListType_init(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":248
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.list_type = <const CListType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 248, __pyx_L1_error)

  /* "pyarrow/types.pxi":249
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.list_type = <const CListType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->list_type = (( arrow::ListType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":247
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CListType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":251
 *         self.list_type = <const CListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return list_, (self.value_type,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8ListType___reduce__[] = "ListType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8ListType___reduce__(((struct __pyx_obj_7pyarrow_3lib_ListType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8ListType___reduce__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":252
 * 
 *     def __reduce__(self):
 *         return list_, (self.value_type,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":251
 *         self.list_type = <const CListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return list_, (self.value_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.lib.ListType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":255
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of list values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8ListType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_ListType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8ListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":259
 *         The data type of list values.
 *         """
 *         return pyarrow_wrap_data_type(self.list_type.value_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->list_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":255
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of list values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ListType.value_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":268
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CLargeListType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_13LargeListType_init(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":269
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.list_type = <const CLargeListType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 269, __pyx_L1_error)

  /* "pyarrow/types.pxi":270
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.list_type = <const CLargeListType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->list_type = (( arrow::LargeListType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":268
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CLargeListType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeListType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":272
 *         self.list_type = <const CLargeListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return large_list, (self.value_type,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13LargeListType___reduce__[] = "LargeListType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13LargeListType___reduce__(((struct __pyx_obj_7pyarrow_3lib_LargeListType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType___reduce__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":273
 * 
 *     def __reduce__(self):
 *         return large_list, (self.value_type,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_large_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":272
 *         self.list_type = <const CLargeListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return large_list, (self.value_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.lib.LargeListType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":276
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of large list values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13LargeListType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_LargeListType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":280
 *         The data type of large list values.
 *         """
 *         return pyarrow_wrap_data_type(self.list_type.value_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->list_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":276
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of large list values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeListType.value_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":288
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_10StructType_init(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":289
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.struct_type = <const CStructType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 289, __pyx_L1_error)

  /* "pyarrow/types.pxi":290
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef Field field(self, int i):
 */
  __pyx_v_self->struct_type = (( arrow::StructType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":288
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":292
 *         self.struct_type = <const CStructType*> type.get()
 * 
 *     cdef Field field(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its index.
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, int __pyx_v_i) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":296
 *         Return a child field by its index.
 *         """
 *         return self.child(i)             # <<<<<<<<<<<<<<
 * 
 *     cdef Field field_by_name(self, name):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_i)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":292
 *         self.struct_type = <const CStructType*> type.get()
 * 
 *     cdef Field field(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its index.
 */

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

/* "pyarrow/types.pxi":298
 *         return self.child(i)
 * 
 *     cdef Field field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its name rather than its index.
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field_by_name(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_name) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_fields;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("field_by_name", 0);

  /* "pyarrow/types.pxi":304
 *         cdef vector[shared_ptr[CField]] fields
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))             # <<<<<<<<<<<<<<
 *         if fields.size() == 0:
 *             raise KeyError(name)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fields = __pyx_v_self->struct_type->GetAllFieldsByName(__pyx_t_4);

  /* "pyarrow/types.pxi":305
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 */
  __pyx_t_5 = ((__pyx_v_fields.size() == 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":306
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:
 *             raise KeyError(name)             # <<<<<<<<<<<<<<
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 306, __pyx_L1_error)

    /* "pyarrow/types.pxi":305
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 */
  }

  /* "pyarrow/types.pxi":307
 *         if fields.size() == 0:
 *             raise KeyError(name)
 *         elif fields.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  __pyx_t_5 = ((__pyx_v_fields.size() > 1) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":308
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             raise KeyError(name)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":309
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":310
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 *             raise KeyError(name)             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_field(fields[0])
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 310, __pyx_L1_error)

    /* "pyarrow/types.pxi":307
 *         if fields.size() == 0:
 *             raise KeyError(name)
 *         elif fields.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  }

  /* "pyarrow/types.pxi":312
 *             raise KeyError(name)
 *         else:
 *             return pyarrow_wrap_field(fields[0])             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field((__pyx_v_fields[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 312, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":298
 *         return self.child(i)
 * 
 *     cdef Field field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its name rather than its index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.StructType.field_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":314
 *             return pyarrow_wrap_field(fields[0])
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children().
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_10StructType_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType___len__[] = "\n        Like num_children().\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_10StructType_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType___len__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_10StructType___len__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":318
 *         Like num_children().
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":314
 *             return pyarrow_wrap_field(fields[0])
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children().
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_10StructType_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":320
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_3__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_2__iter__[] = "\n        Iterate over struct fields, in order.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_2__iter__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_2__iter__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 320, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_10StructType_4generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_StructType___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 320, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructType.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_10StructType_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 320, __pyx_L1_error)

  /* "pyarrow/types.pxi":324
 *         Iterate over struct fields, in order.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 324, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/types.pxi":325
 *         """
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 325, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":320
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":327
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the struct field with the given index or name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_5__getitem__[] = "\n        Return the struct field with the given index or name.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":331
 *         Return the struct field with the given index or name.
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":332
 *         """
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)             # <<<<<<<<<<<<<<
 *         elif isinstance(i, six.integer_types):
 *             return self.child(i)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->field_by_name(__pyx_v_self, __pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":331
 *         Return the struct field with the given index or name.
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 */
  }

  /* "pyarrow/types.pxi":333
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.child(i)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_i, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/types.pxi":334
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 *             return self.child(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Expected integer or string index')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 334, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":333
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.child(i)
 *         else:
 */
  }

  /* "pyarrow/types.pxi":336
 *             return self.child(i)
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 336, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":327
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the struct field with the given index or name.
 */

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

/* "pyarrow/types.pxi":338
 *             raise TypeError('Expected integer or string index')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return struct, (list(self),)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_7__reduce__[] = "StructType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":339
 * 
 *     def __reduce__(self):
 *         return struct, (list(self),)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_struct); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":338
 *             raise TypeError('Expected integer or string index')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return struct, (list(self),)
 * 
 */

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

/* "pyarrow/types.pxi":347
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 * 
 */

static void __pyx_f_7pyarrow_3lib_9UnionType_init(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":348
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 348, __pyx_L1_error)

  /* "pyarrow/types.pxi":347
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":351
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The mode of the union ("dense" or "sparse").
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
   arrow::UnionType *__pyx_v_type;
  int __pyx_v_mode;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":355
 *         The mode of the union ("dense" or "sparse").
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()             # <<<<<<<<<<<<<<
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:
 */
  __pyx_v_type = (( arrow::UnionType *)__pyx_v_self->__pyx_base.sp_type.get());

  /* "pyarrow/types.pxi":356
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()             # <<<<<<<<<<<<<<
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'
 */
  __pyx_v_mode = __pyx_v_type->mode();

  /* "pyarrow/types.pxi":357
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:             # <<<<<<<<<<<<<<
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:
 */
  __pyx_t_1 = ((__pyx_v_mode ==  arrow::UnionMode::DENSE) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":358
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'             # <<<<<<<<<<<<<<
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_dense);
    __pyx_r = __pyx_n_u_dense;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":357
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:             # <<<<<<<<<<<<<<
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:
 */
  }

  /* "pyarrow/types.pxi":359
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return 'sparse'
 *         assert 0
 */
  __pyx_t_1 = ((__pyx_v_mode ==  arrow::UnionMode::SPARSE) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":360
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'             # <<<<<<<<<<<<<<
 *         assert 0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_sparse);
    __pyx_r = __pyx_n_u_sparse;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":359
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return 'sparse'
 *         assert 0
 */
  }

  /* "pyarrow/types.pxi":361
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'
 *         assert 0             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!0)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(4, 361, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":351
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The mode of the union ("dense" or "sparse").
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionType.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":364
 * 
 *     @property
 *     def type_codes(self):             # <<<<<<<<<<<<<<
 *         """
 *         The type code to indicate each data type in this union.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
   arrow::UnionType *__pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":368
 *         The type code to indicate each data type in this union.
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()             # <<<<<<<<<<<<<<
 *         return type.type_codes()
 * 
 */
  __pyx_v_type = (( arrow::UnionType *)__pyx_v_self->__pyx_base.sp_type.get());

  /* "pyarrow/types.pxi":369
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         return type.type_codes()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_uint8_t(__pyx_v_type->type_codes()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":364
 * 
 *     @property
 *     def type_codes(self):             # <<<<<<<<<<<<<<
 *         """
 *         The type code to indicate each data type in this union.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UnionType.type_codes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":371
 *         return type.type_codes()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9UnionType_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType___len__[] = "\n        Like num_children()\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9UnionType_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType___len__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_9UnionType___len__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":375
 *         Like num_children()
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":371
 *         return type.type_codes()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_9UnionType_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":377
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_3__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_2__iter__[] = "\n        Iterate over union members, in order.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 377, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_9UnionType_4generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_UnionType___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 377, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionType.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_9UnionType_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 377, __pyx_L1_error)

  /* "pyarrow/types.pxi":381
 *         Iterate over union members, in order.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 381, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/types.pxi":382
 *         """
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 382, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":377
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":384
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child member by its index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_5__getitem__[] = "\n        Return a child member by its index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":388
 *         Return a child member by its index.
 *         """
 *         return self.child(i)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 388, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_UnionType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":384
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child member by its index.
 */

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

/* "pyarrow/types.pxi":390
 *         return self.child(i)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return union, (list(self), self.mode)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_7__reduce__[] = "UnionType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_7__reduce__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":391
 * 
 *     def __reduce__(self):
 *         return union, (list(self), self.mode)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_union); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":390
 *         return self.child(i)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return union, (list(self), self.mode)
 * 
 */

  /* 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.lib.UnionType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":399
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ts_type = <const CTimestampType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_13TimestampType_init(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":400
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.ts_type = <const CTimestampType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 400, __pyx_L1_error)

  /* "pyarrow/types.pxi":401
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.ts_type = <const CTimestampType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->ts_type = (( arrow::TimestampType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":399
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ts_type = <const CTimestampType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":404
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":408
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.ts_type.unit())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->ts_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":404
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":411
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp time zone, if any, or None.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":415
 *         The timestamp time zone, if any, or None.
 *         """
 *         if self.ts_type.timezone().size() > 0:             # <<<<<<<<<<<<<<
 *             return frombytes(self.ts_type.timezone())
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->ts_type->timezone().size() > 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":416
 *         """
 *         if self.ts_type.timezone().size() > 0:
 *             return frombytes(self.ts_type.timezone())             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->ts_type->timezone()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 416, __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/types.pxi":415
 *         The timestamp time zone, if any, or None.
 *         """
 *         if self.ts_type.timezone().size() > 0:             # <<<<<<<<<<<<<<
 *             return frombytes(self.ts_type.timezone())
 *         else:
 */
  }

  /* "pyarrow/types.pxi":418
 *             return frombytes(self.ts_type.timezone())
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas_dtype(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":411
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp time zone, if any, or None.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.tz.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":420
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13TimestampType_to_pandas_dtype[] = "TimestampType.to_pandas_dtype(self)\n\n        Return the equivalent NumPy / Pandas dtype.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_v_make_datetimetz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("to_pandas_dtype", 0);

  /* "pyarrow/types.pxi":424
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         if self.tz is None:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[_Type_TIMESTAMP]
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":425
 *         """
 *         if self.tz is None:
 *             return _pandas_type_map[_Type_TIMESTAMP]             # <<<<<<<<<<<<<<
 *         else:
 *             # Return DatetimeTZ
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 425, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pandas_type_map, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":424
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         if self.tz is None:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[_Type_TIMESTAMP]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":428
 *         else:
 *             # Return DatetimeTZ
 *             from pyarrow.pandas_compat import make_datetimetz             # <<<<<<<<<<<<<<
 *             return make_datetimetz(self.tz)
 * 
 */
  /*else*/ {
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_make_datetimetz);
    __Pyx_GIVEREF(__pyx_n_s_make_datetimetz);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_make_datetimetz);
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_make_datetimetz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_make_datetimetz = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":429
 *             # Return DatetimeTZ
 *             from pyarrow.pandas_compat import make_datetimetz
 *             return make_datetimetz(self.tz)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_make_datetimetz);
    __pyx_t_5 = __pyx_v_make_datetimetz; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":420
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.to_pandas_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_make_datetimetz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":431
 *             return make_datetimetz(self.tz)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return timestamp, (self.unit, self.tz)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13TimestampType_2__reduce__[] = "TimestampType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":432
 * 
 *     def __reduce__(self):
 *         return timestamp, (self.unit, self.tz)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":431
 *             return make_datetimetz(self.tz)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return timestamp, (self.unit, self.tz)
 * 
 */

  /* 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.lib.TimestampType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":440
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime32Type*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_10Time32Type_init(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":441
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.time_type = <const CTime32Type*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 441, __pyx_L1_error)

  /* "pyarrow/types.pxi":442
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.time_type = <const CTime32Type*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->time_type = (( arrow::Time32Type const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":440
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime32Type*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Time32Type.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":445
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_Time32Type *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":449
 *         The time unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.time_type.unit())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->time_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":445
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time32Type.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":457
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime64Type*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_10Time64Type_init(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":458
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.time_type = <const CTime64Type*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 458, __pyx_L1_error)

  /* "pyarrow/types.pxi":459
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.time_type = <const CTime64Type*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->time_type = (( arrow::Time64Type const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":457
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime64Type*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Time64Type.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":462
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_Time64Type *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":466
 *         The time unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.time_type.unit())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->time_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":462
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time64Type.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":474
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.fixed_size_binary_type = (
 */

static void __pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":475
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.fixed_size_binary_type = (
 *             <const CFixedSizeBinaryType*> type.get())
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 475, __pyx_L1_error)

  /* "pyarrow/types.pxi":476
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.fixed_size_binary_type = (             # <<<<<<<<<<<<<<
 *             <const CFixedSizeBinaryType*> type.get())
 * 
 */
  __pyx_v_self->fixed_size_binary_type = (( arrow::FixedSizeBinaryType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":474
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.fixed_size_binary_type = (
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":479
 *             <const CFixedSizeBinaryType*> type.get())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return binary, (self.byte_width,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19FixedSizeBinaryType___reduce__[] = "FixedSizeBinaryType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType___reduce__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":480
 * 
 *     def __reduce__(self):
 *         return binary, (self.byte_width,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_binary); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_byte_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":479
 *             <const CFixedSizeBinaryType*> type.get())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return binary, (self.byte_width,)
 * 
 */

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

/* "pyarrow/types.pxi":483
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         """
 *         The binary size in bytes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width___get__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":487
 *         The binary size in bytes.
 *         """
 *         return self.fixed_size_binary_type.byte_width()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->fixed_size_binary_type->byte_width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":483
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         """
 *         The binary size in bytes.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryType.byte_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":495
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         FixedSizeBinaryType.init(self, type)
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_14Decimal128Type_init(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":496
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         FixedSizeBinaryType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 496, __pyx_L1_error)

  /* "pyarrow/types.pxi":497
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         FixedSizeBinaryType.init(self, type)
 *         self.decimal128_type = <const CDecimal128Type*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->decimal128_type = (( arrow::Decimal128Type const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":495
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         FixedSizeBinaryType.init(self, type)
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Decimal128Type.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":499
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return decimal128, (self.precision, self.scale)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14Decimal128Type___reduce__[] = "Decimal128Type.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type___reduce__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":500
 * 
 *     def __reduce__(self):
 *         return decimal128, (self.precision, self.scale)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decimal128); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":499
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return decimal128, (self.precision, self.scale)
 * 
 */

  /* 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.lib.Decimal128Type.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":503
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal precision, in number of decimal digits (an integer).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type_9precision___get__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_9precision___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":507
 *         The decimal precision, in number of decimal digits (an integer).
 *         """
 *         return self.decimal128_type.precision()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->decimal128_type->precision()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":503
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal precision, in number of decimal digits (an integer).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Decimal128Type.precision.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":510
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal scale (an integer).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type_5scale___get__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_5scale___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":514
 *         The decimal scale (an integer).
 *         """
 *         return self.decimal128_type.scale()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->decimal128_type->scale()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":510
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal scale (an integer).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Decimal128Type.scale.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":522
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ext_type = <const CExtensionType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_17BaseExtensionType_init(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":523
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.ext_type = <const CExtensionType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 523, __pyx_L1_error)

  /* "pyarrow/types.pxi":524
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.ext_type = <const CExtensionType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->ext_type = (( arrow::ExtensionType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":522
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ext_type = <const CExtensionType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.BaseExtensionType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":527
 * 
 *     @property
 *     def extension_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         The extension type name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_14extension_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_14extension_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17BaseExtensionType_14extension_name___get__(((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_14extension_name___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":531
 *         The extension type name.
 *         """
 *         return frombytes(self.ext_type.extension_name())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->ext_type->extension_name()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(4, 531, __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/types.pxi":527
 * 
 *     @property
 *     def extension_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         The extension type name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.BaseExtensionType.extension_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":534
 * 
 *     @property
 *     def storage_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The underlying storage type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_12storage_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_12storage_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17BaseExtensionType_12storage_type___get__(((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_12storage_type___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":538
 *         The underlying storage type.
 *         """
 *         return pyarrow_wrap_data_type(self.ext_type.storage_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ext_type->storage_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":534
 * 
 *     @property
 *     def storage_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The underlying storage type.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BaseExtensionType.storage_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":546
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

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

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

static int __pyx_pf_7pyarrow_3lib_13ExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":547
 * 
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "ExtensionType")
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":548
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "ExtensionType")
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 548, __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(4, 548, __pyx_L1_error)

    /* "pyarrow/types.pxi":547
 * 
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "ExtensionType")
 */
  }

  /* "pyarrow/types.pxi":546
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":551
 *                             "ExtensionType")
 * 
 *     def __init__(self, DataType storage_type, extension_name):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize an extension type instance.
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13ExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ExtensionType_2__init__[] = "\n        Initialize an extension type instance.\n\n        This should be called at the end of the subclass'\n        ``__init__`` method.\n\n        Parameters\n        ----------\n        storage_type : DataType\n        extension_name : str\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__;
#endif
static int __pyx_pw_7pyarrow_3lib_13ExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  PyObject *__pyx_v_extension_name = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_extension_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extension_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(4, 551, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 551, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
    __pyx_v_extension_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 551, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "storage_type", 0))) __PYX_ERR(4, 551, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_2__init__(((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)__pyx_v_self), __pyx_v_storage_type, __pyx_v_extension_name);

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

static int __pyx_pf_7pyarrow_3lib_13ExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_extension_name) {
  std::shared_ptr< arrow::ExtensionType>  __pyx_v_cpy_ext_type;
  std::string __pyx_v_c_extension_name;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":567
 *             c_string c_extension_name
 * 
 *         c_extension_name = tobytes(extension_name)             # <<<<<<<<<<<<<<
 * 
 *         assert storage_type is not None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_extension_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_extension_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_extension_name = __pyx_t_4;

  /* "pyarrow/types.pxi":569
 *         c_extension_name = tobytes(extension_name)
 * 
 *         assert storage_type is not None             # <<<<<<<<<<<<<<
 *         check_status(CPyExtensionType.FromClass(
 *             storage_type.sp_type, c_extension_name, type(self),
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_5 = (((PyObject *)__pyx_v_storage_type) != Py_None);
    if (unlikely(!(__pyx_t_5 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(4, 569, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":570
 * 
 *         assert storage_type is not None
 *         check_status(CPyExtensionType.FromClass(             # <<<<<<<<<<<<<<
 *             storage_type.sp_type, c_extension_name, type(self),
 *             &cpy_ext_type))
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::py::PyExtensionType::FromClass(__pyx_v_storage_type->sp_type, __pyx_v_c_extension_name, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), (&__pyx_v_cpy_ext_type))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 570, __pyx_L1_error)

  /* "pyarrow/types.pxi":573
 *             storage_type.sp_type, c_extension_name, type(self),
 *             &cpy_ext_type))
 *         self.init(<shared_ptr[CDataType]> cpy_ext_type)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), ((std::shared_ptr< arrow::DataType> )__pyx_v_cpy_ext_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 573, __pyx_L1_error)

  /* "pyarrow/types.pxi":551
 *                             "ExtensionType")
 * 
 *     def __init__(self, DataType storage_type, extension_name):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize an extension type instance.
 */

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

/* "pyarrow/types.pxi":575
 *         self.init(<shared_ptr[CDataType]> cpy_ext_type)
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         BaseExtensionType.init(self, type)
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_13ExtensionType_init(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":576
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         BaseExtensionType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 *         # Store weakref and serialized version of self on C++ type instance
 */
  __pyx_f_7pyarrow_3lib_17BaseExtensionType_init(((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 576, __pyx_L1_error)

  /* "pyarrow/types.pxi":577
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         BaseExtensionType.init(self, type)
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()             # <<<<<<<<<<<<<<
 *         # Store weakref and serialized version of self on C++ type instance
 *         check_status(self.cpy_ext_type.SetInstance(self))
 */
  __pyx_v_self->cpy_ext_type = (( arrow::py::PyExtensionType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":579
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 *         # Store weakref and serialized version of self on C++ type instance
 *         check_status(self.cpy_ext_type.SetInstance(self))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->cpy_ext_type->SetInstance(((PyObject *)__pyx_v_self))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 579, __pyx_L1_error)

  /* "pyarrow/types.pxi":575
 *         self.init(<shared_ptr[CDataType]> cpy_ext_type)
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         BaseExtensionType.init(self, type)
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":581
 *         check_status(self.cpy_ext_type.SetInstance(self))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_4__eq__(((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_4__eq__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":584
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 *         if isinstance(other, ExtensionType):             # <<<<<<<<<<<<<<
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_ExtensionType); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":585
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 *         if isinstance(other, ExtensionType):
 *             return (type(self) == type(other) and             # <<<<<<<<<<<<<<
 *                     self.extension_name == other.extension_name and
 *                     self.storage_type == other.storage_type)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), ((PyObject *)Py_TYPE(__pyx_v_other)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 585, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 585, __pyx_L1_error)
    if (__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_bool_binop_done;
    }

    /* "pyarrow/types.pxi":586
 *         if isinstance(other, ExtensionType):
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and             # <<<<<<<<<<<<<<
 *                     self.storage_type == other.storage_type)
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extension_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_extension_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 586, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 586, __pyx_L1_error)
    if (__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_3 = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_bool_binop_done;
    }

    /* "pyarrow/types.pxi":587
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and
 *                     self.storage_type == other.storage_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_storage_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_storage_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 587, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_L4_bool_binop_done:;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":584
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 *         if isinstance(other, ExtensionType):             # <<<<<<<<<<<<<<
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and
 */
  }

  /* "pyarrow/types.pxi":589
 *                     self.storage_type == other.storage_type)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __arrow_ext_serialize__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":581
 *         check_status(self.cpy_ext_type.SetInstance(self))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":591
 *             return NotImplemented
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Serialized representation of metadata to reconstruct the type object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__[] = "ExtensionType.__arrow_ext_serialize__(self)\n\n        Serialized representation of metadata to reconstruct the type object.\n\n        This method should return a bytes object, and those serialized bytes\n        are stored in the custom metadata of the Field holding an extension\n        type in an IPC message.\n        The bytes are passed to ``__arrow_ext_deserialize`` and should hold\n        sufficient information to reconstruct the data type instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__(((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__", 0);

  /* "pyarrow/types.pxi":601
 *         sufficient information to reconstruct the data type instance.
 *         """
 *         return NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_r = __pyx_builtin_NotImplementedError;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":591
 *             return NotImplemented
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Serialized representation of metadata to reconstruct the type object.
 */

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

/* "pyarrow/types.pxi":604
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         """
 *         Return an extension type instance from the storage type and serialized
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__[] = "ExtensionType.__arrow_ext_deserialize__(type self, storage_type, serialized)\n\n        Return an extension type instance from the storage type and serialized\n        metadata.\n\n        This method should return an instance of the ExtensionType subclass\n        that matches the passed storage type and serialized metadata (the\n        return value of ``__arrow_ext_serialize__``).\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_storage_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_serialized,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serialized)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, 1); __PYX_ERR(4, 604, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__arrow_ext_deserialize__") < 0)) __PYX_ERR(4, 604, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = values[0];
    __pyx_v_serialized = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 604, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__(((PyTypeObject*)__pyx_v_self), __pyx_v_storage_type, __pyx_v_serialized);

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

static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_storage_type, CYTHON_UNUSED PyObject *__pyx_v_serialized) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__", 0);

  /* "pyarrow/types.pxi":613
 *         return value of ``__arrow_ext_serialize__``).
 *         """
 *         return NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_r = __pyx_builtin_NotImplementedError;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":604
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         """
 *         Return an extension type instance from the storage type and serialized
 */

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

/* "pyarrow/types.pxi":622
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

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

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

static int __pyx_pf_7pyarrow_3lib_15PyExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":623
 * 
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "PyExtensionType")
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":624
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "PyExtensionType")
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 624, __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(4, 624, __pyx_L1_error)

    /* "pyarrow/types.pxi":623
 * 
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "PyExtensionType")
 */
  }

  /* "pyarrow/types.pxi":622
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":627
 *                             "PyExtensionType")
 * 
 *     def __init__(self, DataType storage_type):             # <<<<<<<<<<<<<<
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15PyExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15PyExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 627, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 627, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "storage_type", 0))) __PYX_ERR(4, 627, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_2__init__(((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)__pyx_v_self), __pyx_v_storage_type);

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

static int __pyx_pf_7pyarrow_3lib_15PyExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type) {
  int __pyx_r;
  __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 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":628
 * 
 *     def __init__(self, DataType storage_type):
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type), __pyx_kp_u_arrow_py_extension_type};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 628, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type), __pyx_kp_u_arrow_py_extension_type};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 628, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_storage_type));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_storage_type));
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_storage_type));
    __Pyx_INCREF(__pyx_kp_u_arrow_py_extension_type);
    __Pyx_GIVEREF(__pyx_kp_u_arrow_py_extension_type);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_kp_u_arrow_py_extension_type);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":627
 *                             "PyExtensionType")
 * 
 *     def __init__(self, DataType storage_type):             # <<<<<<<<<<<<<<
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":630
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Please implement {0}.__reduce__"
 *                                   .format(type(self).__name__))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15PyExtensionType_4__reduce__[] = "PyExtensionType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_4__reduce__(((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":632
 *     def __reduce__(self):
 *         raise NotImplementedError("Please implement {0}.__reduce__"
 *                                   .format(type(self).__name__))             # <<<<<<<<<<<<<<
 * 
 *     def __arrow_ext_serialize__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Please_implement_0___reduce, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(4, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":631
 * 
 *     def __reduce__(self):
 *         raise NotImplementedError("Please implement {0}.__reduce__"             # <<<<<<<<<<<<<<
 *                                   .format(type(self).__name__))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(4, 631, __pyx_L1_error)

  /* "pyarrow/types.pxi":630
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Please implement {0}.__reduce__"
 *                                   .format(type(self).__name__))
 */

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

/* "pyarrow/types.pxi":634
 *                                   .format(type(self).__name__))
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return builtin_pickle.dumps(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__[] = "PyExtensionType.__arrow_ext_serialize__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__(((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__", 0);

  /* "pyarrow/types.pxi":635
 * 
 *     def __arrow_ext_serialize__(self):
 *         return builtin_pickle.dumps(self)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":634
 *                                   .format(type(self).__name__))
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return builtin_pickle.dumps(self)
 * 
 */

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

/* "pyarrow/types.pxi":638
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__[] = "PyExtensionType.__arrow_ext_deserialize__(type cls, storage_type, serialized)";
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_storage_type = 0;
  PyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_serialized,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serialized)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, 1); __PYX_ERR(4, 638, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__arrow_ext_deserialize__") < 0)) __PYX_ERR(4, 638, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = values[0];
    __pyx_v_serialized = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 638, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__(((PyTypeObject*)__pyx_v_cls), __pyx_v_storage_type, __pyx_v_serialized);

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

static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_storage_type, PyObject *__pyx_v_serialized) {
  PyObject *__pyx_v_ty = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__", 0);

  /* "pyarrow/types.pxi":639
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:             # <<<<<<<<<<<<<<
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:
 */
  {
    __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/types.pxi":640
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:
 *             ty = builtin_pickle.loads(serialized)             # <<<<<<<<<<<<<<
 *         except Exception:
 *             # For some reason, it's impossible to deserialize the
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 640, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 640, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_serialized) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_serialized);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 640, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_ty = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":639
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:             # <<<<<<<<<<<<<<
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:
 */
    }
    __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;

    /* "pyarrow/types.pxi":641
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:             # <<<<<<<<<<<<<<
 *             # For some reason, it's impossible to deserialize the
 *             # ExtensionType instance.  Perhaps the serialized data is
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(4, 641, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);

      /* "pyarrow/types.pxi":647
 *             # in an environment where the original Python class or module
 *             # is not available.  Fall back on a generic BaseExtensionType.
 *             return UnknownExtensionType(storage_type, serialized)             # <<<<<<<<<<<<<<
 * 
 *         if ty.storage_type != storage_type:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 647, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_storage_type);
      __Pyx_GIVEREF(__pyx_v_storage_type);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_storage_type);
      __Pyx_INCREF(__pyx_v_serialized);
      __Pyx_GIVEREF(__pyx_v_serialized);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_serialized);
      __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_UnknownExtensionType), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 647, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 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;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":639
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:             # <<<<<<<<<<<<<<
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:
 */
    __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/types.pxi":649
 *             return UnknownExtensionType(storage_type, serialized)
 * 
 *         if ty.storage_type != storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ty, __pyx_n_s_storage_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_storage_type, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(4, 649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(__pyx_t_10)) {

    /* "pyarrow/types.pxi":651
 *         if ty.storage_type != storage_type:
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))             # <<<<<<<<<<<<<<
 *         return ty
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Expected_storage_type_0_but_got, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ty, __pyx_n_s_storage_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_4, __pyx_v_storage_type};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 651, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_4, __pyx_v_storage_type};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 651, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_INCREF(__pyx_v_storage_type);
      __Pyx_GIVEREF(__pyx_v_storage_type);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_storage_type);
      __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/types.pxi":650
 * 
 *         if ty.storage_type != storage_type:
 *             raise TypeError("Expected storage type {0} but got {1}"             # <<<<<<<<<<<<<<
 *                             .format(ty.storage_type, storage_type))
 *         return ty
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(4, 650, __pyx_L1_error)

    /* "pyarrow/types.pxi":649
 *             return UnknownExtensionType(storage_type, serialized)
 * 
 *         if ty.storage_type != storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))
 */
  }

  /* "pyarrow/types.pxi":652
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))
 *         return ty             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ty);
  __pyx_r = __pyx_v_ty;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":638
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ty);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":664
 *         bytes serialized
 * 
 *     def __init__(self, DataType storage_type, serialized):             # <<<<<<<<<<<<<<
 *         self.serialized = serialized
 *         PyExtensionType.__init__(self, storage_type)
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20UnknownExtensionType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20UnknownExtensionType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  PyObject *__pyx_v_serialized = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_serialized,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serialized)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(4, 664, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 664, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
    __pyx_v_serialized = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 664, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnknownExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "storage_type", 0))) __PYX_ERR(4, 664, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_20UnknownExtensionType___init__(((struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)__pyx_v_self), __pyx_v_storage_type, __pyx_v_serialized);

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

static int __pyx_pf_7pyarrow_3lib_20UnknownExtensionType___init__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_serialized) {
  int __pyx_r;
  __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 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":665
 * 
 *     def __init__(self, DataType storage_type, serialized):
 *         self.serialized = serialized             # <<<<<<<<<<<<<<
 *         PyExtensionType.__init__(self, storage_type)
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_serialized))||((__pyx_v_serialized) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_serialized)->tp_name), 0))) __PYX_ERR(4, 665, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_serialized;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->serialized);
  __Pyx_DECREF(__pyx_v_self->serialized);
  __pyx_v_self->serialized = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":666
 *     def __init__(self, DataType storage_type, serialized):
 *         self.serialized = serialized
 *         PyExtensionType.__init__(self, storage_type)             # <<<<<<<<<<<<<<
 * 
 *     def __arrow_ext_serialize__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 666, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 666, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_storage_type));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_storage_type));
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_storage_type));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":664
 *         bytes serialized
 * 
 *     def __init__(self, DataType storage_type, serialized):             # <<<<<<<<<<<<<<
 *         self.serialized = serialized
 *         PyExtensionType.__init__(self, storage_type)
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.UnknownExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":668
 *         PyExtensionType.__init__(self, storage_type)
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return self.serialized
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20UnknownExtensionType_3__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__[] = "UnknownExtensionType.__arrow_ext_serialize__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20UnknownExtensionType_3__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__(((struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__", 0);

  /* "pyarrow/types.pxi":669
 * 
 *     def __arrow_ext_serialize__(self):
 *         return self.serialized             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->serialized);
  __pyx_r = __pyx_v_self->serialized;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":668
 *         PyExtensionType.__init__(self, storage_type)
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return self.serialized
 * 
 */

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

/* "pyarrow/types.pxi":675
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21register_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_ext_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20register_extension_type[] = "register_extension_type(ext_type)\n\n    Register a Python extension type.\n\n    Registration is based on the extension name (so different registered types\n    need unique extension names). Registration needs an extension type\n    instance, but then works for any instance of the same subclass regardless\n    of parametrization of the type.\n\n    Parameters\n    ----------\n    ext_type : BaseExtensionType instance\n        The ExtensionType subclass to register.\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_21register_extension_type = {"register_extension_type", (PyCFunction)__pyx_pw_7pyarrow_3lib_21register_extension_type, METH_O, __pyx_doc_7pyarrow_3lib_20register_extension_type};
static PyObject *__pyx_pw_7pyarrow_3lib_21register_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_ext_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_extension_type (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20register_extension_type(__pyx_self, ((PyObject *)__pyx_v_ext_type));

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

static PyObject *__pyx_pf_7pyarrow_3lib_20register_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ext_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__type = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("register_extension_type", 0);

  /* "pyarrow/types.pxi":691
 *     """
 *     cdef:
 *         DataType _type = ensure_type(ext_type, allow_none=False)             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(_type, BaseExtensionType):
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_ext_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":693
 *         DataType _type = ensure_type(ext_type, allow_none=False)
 * 
 *     if not isinstance(_type, BaseExtensionType):             # <<<<<<<<<<<<<<
 *         raise TypeError("Only extension types can be registered")
 * 
 */
  __pyx_t_3 = __Pyx_TypeCheck(((PyObject *)__pyx_v__type), __pyx_ptype_7pyarrow_3lib_BaseExtensionType); 
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/types.pxi":694
 * 
 *     if not isinstance(_type, BaseExtensionType):
 *         raise TypeError("Only extension types can be registered")             # <<<<<<<<<<<<<<
 * 
 *     # register on the C++ side
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 694, __pyx_L1_error)

    /* "pyarrow/types.pxi":693
 *         DataType _type = ensure_type(ext_type, allow_none=False)
 * 
 *     if not isinstance(_type, BaseExtensionType):             # <<<<<<<<<<<<<<
 *         raise TypeError("Only extension types can be registered")
 * 
 */
  }

  /* "pyarrow/types.pxi":697
 * 
 *     # register on the C++ side
 *     check_status(             # <<<<<<<<<<<<<<
 *         RegisterPyExtensionType(<shared_ptr[CDataType]> _type.sp_type))
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::RegisterPyExtensionType(((std::shared_ptr< arrow::DataType> )__pyx_v__type->sp_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 697, __pyx_L1_error)

  /* "pyarrow/types.pxi":701
 * 
 *     # register on the python side
 *     _python_extension_types_registry.append(_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_python_extension_types_registry); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, ((PyObject *)__pyx_v__type)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":675
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */

  /* 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.lib.register_extension_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":704
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23unregister_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_type_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22unregister_extension_type[] = "unregister_extension_type(type_name)\n\n    Unregister a Python extension type.\n\n    Parameters\n    ----------\n    type_name : str\n        The name of the ExtensionType subclass to unregister.\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_23unregister_extension_type = {"unregister_extension_type", (PyCFunction)__pyx_pw_7pyarrow_3lib_23unregister_extension_type, METH_O, __pyx_doc_7pyarrow_3lib_22unregister_extension_type};
static PyObject *__pyx_pw_7pyarrow_3lib_23unregister_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_type_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unregister_extension_type (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22unregister_extension_type(__pyx_self, ((PyObject *)__pyx_v_type_name));

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

static PyObject *__pyx_pf_7pyarrow_3lib_22unregister_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type_name) {
  std::string __pyx_v_c_type_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("unregister_extension_type", 0);

  /* "pyarrow/types.pxi":715
 *     """
 *     cdef:
 *         c_string c_type_name = tobytes(type_name)             # <<<<<<<<<<<<<<
 *     check_status(UnregisterPyExtensionType(c_type_name))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_type_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_type_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_type_name = __pyx_t_4;

  /* "pyarrow/types.pxi":716
 *     cdef:
 *         c_string c_type_name = tobytes(type_name)
 *     check_status(UnregisterPyExtensionType(c_type_name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::UnregisterPyExtensionType(__pyx_v_c_type_name)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 716, __pyx_L1_error)

  /* "pyarrow/types.pxi":704
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */

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

/* "pyarrow/types.pxi":727
 *     Do not use this class's constructor directly; use pyarrow.field
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

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

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

static int __pyx_pf_7pyarrow_3lib_5Field___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

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

/* "pyarrow/types.pxi":730
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Field's constructor directly, use "
 *                         "`pyarrow.field` instead.")
 */

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

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

static int __pyx_pf_7pyarrow_3lib_5Field_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":731
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Field's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.field` instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 731, __pyx_L1_error)

  /* "pyarrow/types.pxi":730
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Field's constructor directly, use "
 *                         "`pyarrow.field` instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":734
 *                         "`pyarrow.field` instead.")
 * 
 *     cdef void init(self, const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *         self.sp_field = field
 *         self.field = field.get()
 */

static void __pyx_f_7pyarrow_3lib_5Field_init(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, std::shared_ptr< arrow::Field>  const &__pyx_v_field) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":735
 * 
 *     cdef void init(self, const shared_ptr[CField]& field):
 *         self.sp_field = field             # <<<<<<<<<<<<<<
 *         self.field = field.get()
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 */
  __pyx_v_self->sp_field = __pyx_v_field;

  /* "pyarrow/types.pxi":736
 *     cdef void init(self, const shared_ptr[CField]& field):
 *         self.sp_field = field
 *         self.field = field.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 * 
 */
  __pyx_v_self->field = __pyx_v_field.get();

  /* "pyarrow/types.pxi":737
 *         self.sp_field = field
 *         self.field = field.get()
 *         self.type = pyarrow_wrap_data_type(field.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Field other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_field.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 737, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":734
 *                         "`pyarrow.field` instead.")
 * 
 *     cdef void init(self, const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *         self.sp_field = field
 *         self.field = field.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.Field.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":739
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 * 
 *     def equals(self, Field other):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this field is equal to the other
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_4equals[] = "Field.equals(self, Field other)\n\n        Test if this field is equal to the other\n\n        Parameters\n        ----------\n        other : pyarrow.Field\n\n        Returns\n        -------\n        is_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Field, 1, "other", 0))) __PYX_ERR(4, 739, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_4equals(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4equals(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/types.pxi":751
 *         is_equal : boolean
 *         """
 *         return self.field.Equals(deref(other.field))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->field->Equals((*__pyx_v_other->field))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":739
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 * 
 *     def equals(self, Field other):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this field is equal to the other
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":753
 *         return self.field.Equals(deref(other.field))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_6__eq__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_6__eq__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":754
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __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/types.pxi":755
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 755, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 755, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/types.pxi":754
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __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;

    /* "pyarrow/types.pxi":756
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Field.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 756, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":757
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":754
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":753
 *         return self.field.Equals(deref(other.field))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Field.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":759
 *             return NotImplemented
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_8__reduce__[] = "Field.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_8__reduce__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":760
 * 
 *     def __reduce__(self):
 *         return field, (self.name, self.type, self.nullable, self.metadata)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nullable); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":759
 *             return NotImplemented
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 */

  /* 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.lib.Field.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":762
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_11__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_11__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_10__str__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":763
 * 
 *     def __str__(self):
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Field_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->ToString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(4, 763, __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/types.pxi":762
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Field.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":765
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_13__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_13__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_12__repr__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_12__repr__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/types.pxi":766
 * 
 *     def __repr__(self):
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 766, __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/types.pxi":765
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

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

/* "pyarrow/types.pxi":768
 *         return self.__str__()
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.field.name(), self.type, self.field.nullable()))
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_5Field_15__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_5Field_15__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_14__hash__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static Py_hash_t __pyx_pf_7pyarrow_3lib_5Field_14__hash__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/types.pxi":769
 * 
 *     def __hash__(self):
 *         return hash((self.field.name(), self.type, self.field.nullable()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->name()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->field->nullable()); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(4, 769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":768
 *         return self.__str__()
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.field.name(), self.type, self.field.nullable()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Field.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":772
 * 
 *     @property
 *     def nullable(self):             # <<<<<<<<<<<<<<
 *         return self.field.nullable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8nullable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8nullable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_8nullable___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8nullable___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":773
 *     @property
 *     def nullable(self):
 *         return self.field.nullable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->field->nullable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":772
 * 
 *     @property
 *     def nullable(self):             # <<<<<<<<<<<<<<
 *         return self.field.nullable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.nullable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":776
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.field.name())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_4name___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4name___get__(struct __pyx_obj_7pyarrow_3lib_Field *__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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":777
 *     @property
 *     def name(self):
 *         return frombytes(self.field.name())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->name()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(4, 777, __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/types.pxi":776
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.field.name())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Field.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":780
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":781
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_metadata(self.field.metadata())             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(__pyx_v_self->field->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":780
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":783
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_17add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_16add_metadata[] = "Field.add_metadata(self, metadata)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_17add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_16add_metadata(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_16add_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":784
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":785
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 *         return self.with_metadata(metadata)
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(4, 785, __pyx_L1_error)

  /* "pyarrow/types.pxi":784
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 784, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":786
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     def with_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_with_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_metadata) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_metadata);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 786, __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/types.pxi":783
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

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

/* "pyarrow/types.pxi":788
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Field
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_19with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_18with_metadata[] = "Field.with_metadata(self, metadata)\n\n        Add metadata as dict of string keys and values to Field\n\n        Parameters\n        ----------\n        metadata : dict\n            Keys and values must be string-like / coercible to bytes\n\n        Returns\n        -------\n        field : pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_19with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("with_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_18with_metadata(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_18with_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::Field>  __pyx_v_c_field;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("with_metadata", 0);

  /* "pyarrow/types.pxi":805
 *             shared_ptr[CKeyValueMetadata] c_meta
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_metadata); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":806
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 806, __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(4, 806, __pyx_L1_error)

    /* "pyarrow/types.pxi":805
 *             shared_ptr[CKeyValueMetadata] c_meta
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  }

  /* "pyarrow/types.pxi":808
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             c_field = self.field.WithMetadata(c_meta)
 */
  __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

  /* "pyarrow/types.pxi":809
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_field = self.field.WithMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":810
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:
 *             c_field = self.field.WithMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_field(c_field)
 */
        __pyx_v_c_field = __pyx_v_self->field->WithMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":809
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_field = self.field.WithMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":812
 *             c_field = self.field.WithMetadata(c_meta)
 * 
 *         return pyarrow_wrap_field(c_field)             # <<<<<<<<<<<<<<
 * 
 *     def remove_metadata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_c_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":788
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Field.with_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":814
 *         return pyarrow_wrap_field(c_field)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new field without metadata, if any
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_21remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_20remove_metadata[] = "Field.remove_metadata(self)\n\n        Create new field without metadata, if any\n\n        Returns\n        -------\n        field : pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_21remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_20remove_metadata(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_20remove_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  std::shared_ptr< arrow::Field>  __pyx_v_new_field;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("remove_metadata", 0);

  /* "pyarrow/types.pxi":823
 *         """
 *         cdef shared_ptr[CField] new_field
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_field = self.field.RemoveMetadata()
 *         return pyarrow_wrap_field(new_field)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":824
 *         cdef shared_ptr[CField] new_field
 *         with nogil:
 *             new_field = self.field.RemoveMetadata()             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(new_field)
 * 
 */
        __pyx_v_new_field = __pyx_v_self->field->RemoveMetadata();
      }

      /* "pyarrow/types.pxi":823
 *         """
 *         cdef shared_ptr[CField] new_field
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_field = self.field.RemoveMetadata()
 *         return pyarrow_wrap_field(new_field)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":825
 *         with nogil:
 *             new_field = self.field.RemoveMetadata()
 *         return pyarrow_wrap_field(new_field)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_new_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":814
 *         return pyarrow_wrap_field(c_field)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new field without metadata, if any
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.remove_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":827
 *         return pyarrow_wrap_field(new_field)
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this field.  If a struct field, individual child fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_23flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_22flatten[] = "Field.flatten(self)\n\n        Flatten this field.  If a struct field, individual child fields\n        will be returned with their names prefixed by the parent's name.\n\n        Returns\n        -------\n        fields : List[pyarrow.Field]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_23flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_22flatten(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_22flatten(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_flattened;
  std::shared_ptr< arrow::Field>  __pyx_7genexpr__pyx_v_f;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::shared_ptr< arrow::Field> > ::iterator __pyx_t_2;
  std::shared_ptr< arrow::Field>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/types.pxi":837
 *         """
 *         cdef vector[shared_ptr[CField]] flattened
 *         with nogil:             # <<<<<<<<<<<<<<
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":838
 *         cdef vector[shared_ptr[CField]] flattened
 *         with nogil:
 *             flattened = self.field.Flatten()             # <<<<<<<<<<<<<<
 *         return [pyarrow_wrap_field(f) for f in flattened]
 * 
 */
        __pyx_v_flattened = __pyx_v_self->field->Flatten();
      }

      /* "pyarrow/types.pxi":837
 *         """
 *         cdef vector[shared_ptr[CField]] flattened
 *         with nogil:             # <<<<<<<<<<<<<<
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":839
 *         with nogil:
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_flattened.begin();
    for (;;) {
      if (!(__pyx_t_2 != __pyx_v_flattened.end())) break;
      __pyx_t_3 = *__pyx_t_2;
      ++__pyx_t_2;
      __pyx_7genexpr__pyx_v_f = __pyx_t_3;
      __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_7genexpr__pyx_v_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":827
 *         return pyarrow_wrap_field(new_field)
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this field.  If a struct field, individual child fields
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Field.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":138
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CField]& field)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4type___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

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

/* "pyarrow/types.pxi":844
 * cdef class Schema:
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

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

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

static int __pyx_pf_7pyarrow_3lib_6Schema___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

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

/* "pyarrow/types.pxi":847
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Schema's constructor directly, use "
 *                         "`pyarrow.schema` instead.")
 */

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

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

static int __pyx_pf_7pyarrow_3lib_6Schema_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":848
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Schema's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.schema` instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 848, __pyx_L1_error)

  /* "pyarrow/types.pxi":847
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Schema's constructor directly, use "
 *                         "`pyarrow.schema` instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":851
 *                         "`pyarrow.schema` instead.")
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.schema.num_fields()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Schema_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Schema_5__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_4__len__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Schema_4__len__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":852
 * 
 *     def __len__(self):
 *         return self.schema.num_fields()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __pyx_r = __pyx_v_self->schema->num_fields();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":851
 *                         "`pyarrow.schema` instead.")
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.schema.num_fields()
 * 
 */

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

/* "pyarrow/types.pxi":854
 *         return self.schema.num_fields()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         # access by integer index
 *         return self._field(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_6__getitem__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_6__getitem__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":856
 *     def __getitem__(self, key):
 *         # access by integer index
 *         return self._field(key)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 856, __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/types.pxi":854
 *         return self.schema.num_fields()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         # access by integer index
 *         return self._field(key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_6Schema_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":858
 *         return self._field(key)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_9__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_9__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_8__iter__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8__iter__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 858, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_6Schema_10generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Schema___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 858, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_6Schema_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 858, __pyx_L1_error)

  /* "pyarrow/types.pxi":859
 * 
 *     def __iter__(self):
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 859, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/types.pxi":860
 *     def __iter__(self):
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 860, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":858
 *         return self._field(key)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":862
 *             yield self[i]
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):             # <<<<<<<<<<<<<<
 *         self.schema = new CSchema(fields)
 *         self.sp_schema.reset(self.schema)
 */

static void __pyx_f_7pyarrow_3lib_6Schema_init(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::vector<std::shared_ptr< arrow::Field> >  const &__pyx_v_fields) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":863
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):
 *         self.schema = new CSchema(fields)             # <<<<<<<<<<<<<<
 *         self.sp_schema.reset(self.schema)
 * 
 */
  __pyx_v_self->schema = new  arrow::Schema(__pyx_v_fields);

  /* "pyarrow/types.pxi":864
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):
 *         self.schema = new CSchema(fields)
 *         self.sp_schema.reset(self.schema)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):
 */
  __pyx_v_self->sp_schema.reset(__pyx_v_self->schema);

  /* "pyarrow/types.pxi":862
 *             yield self[i]
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):             # <<<<<<<<<<<<<<
 *         self.schema = new CSchema(fields)
 *         self.sp_schema.reset(self.schema)
 */

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

/* "pyarrow/types.pxi":866
 *         self.sp_schema.reset(self.schema)
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *         self.schema = schema.get()
 *         self.sp_schema = schema
 */

static void __pyx_f_7pyarrow_3lib_6Schema_init_schema(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::shared_ptr< arrow::Schema>  const &__pyx_v_schema) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_schema", 0);

  /* "pyarrow/types.pxi":867
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):
 *         self.schema = schema.get()             # <<<<<<<<<<<<<<
 *         self.sp_schema = schema
 * 
 */
  __pyx_v_self->schema = __pyx_v_schema.get();

  /* "pyarrow/types.pxi":868
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):
 *         self.schema = schema.get()
 *         self.sp_schema = schema             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->sp_schema = __pyx_v_schema;

  /* "pyarrow/types.pxi":866
 *         self.sp_schema.reset(self.schema)
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *         self.schema = schema.get()
 *         self.sp_schema = schema
 */

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

/* "pyarrow/types.pxi":870
 *         self.sp_schema = schema
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return schema, (list(self), self.metadata)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_12__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_11__reduce__[] = "Schema.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_12__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_11__reduce__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":871
 * 
 *     def __reduce__(self):
 *         return schema, (list(self), self.metadata)             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":870
 *         self.sp_schema = schema
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return schema, (list(self), self.metadata)
 * 
 */

  /* 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.lib.Schema.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":873
 *         return schema, (list(self), self.metadata)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((tuple(self), self.metadata))
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_6Schema_14__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_6Schema_14__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static Py_hash_t __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/types.pxi":874
 * 
 *     def __hash__(self):
 *         return hash((tuple(self), self.metadata))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(4, 874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":873
 *         return schema, (list(self), self.metadata)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((tuple(self), self.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.lib.Schema.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":877
 * 
 *     @property
 *     def pandas_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_v_metadata = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_json = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __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 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":881
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 *         """
 *         metadata = self.metadata             # <<<<<<<<<<<<<<
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_metadata = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":882
 *         """
 *         metadata = self.metadata
 *         key = b'pandas'             # <<<<<<<<<<<<<<
 *         if metadata is None or key not in metadata:
 *             return None
 */
  __Pyx_INCREF(__pyx_n_b_pandas);
  __pyx_v_key = __pyx_n_b_pandas;

  /* "pyarrow/types.pxi":883
 *         metadata = self.metadata
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_3 = (__pyx_v_metadata == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_metadata, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 883, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":884
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         import json
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":883
 *         metadata = self.metadata
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  }

  /* "pyarrow/types.pxi":886
 *             return None
 * 
 *         import json             # <<<<<<<<<<<<<<
 *         return json.loads(metadata[key].decode('utf8'))
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_json = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":887
 * 
 *         import json
 *         return json.loads(metadata[key].decode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_metadata, __pyx_v_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_utf8);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":877
 * 
 *     @property
 *     def pandas_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Schema.pandas_metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_json);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":890
 * 
 *     @property
 *     def names(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field names.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_5names___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5names___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  int __pyx_v_i;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __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;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":899
 *         """
 *         cdef int i
 *         result = []             # <<<<<<<<<<<<<<
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":900
 *         cdef int i
 *         result = []
 *         for i in range(self.schema.num_fields()):             # <<<<<<<<<<<<<<
 *             name = frombytes(self.schema.field(i).get().name())
 *             result.append(name)
 */
  __pyx_t_2 = __pyx_v_self->schema->num_fields();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/types.pxi":901
 *         result = []
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())             # <<<<<<<<<<<<<<
 *             result.append(name)
 *         return result
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->schema->field(__pyx_v_i).get()->name()); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":902
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())
 *             result.append(name)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 902, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":903
 *             name = frombytes(self.schema.field(i).get().name())
 *             result.append(name)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":890
 * 
 *     @property
 *     def names(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field names.
 */

  /* 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_7);
  __Pyx_AddTraceback("pyarrow.lib.Schema.names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":906
 * 
 *     @property
 *     def types(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field types.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_5types___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5types___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_8genexpr1__pyx_v_field = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":914
 *         list of DataType
 *         """
 *         return [field.type for field in self]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 914, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
      __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 914, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 914, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(4, 914, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 914, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(4, 914, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 914, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(4, 914, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_field, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 914, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 914, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":906
 * 
 *     @property
 *     def types(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field types.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.types.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":917
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":918
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_metadata(self.schema.metadata())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(__pyx_v_self->schema->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":917
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":920
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_16__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_16__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_15__eq__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15__eq__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":921
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __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/types.pxi":922
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 922, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 922, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/types.pxi":921
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __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;

    /* "pyarrow/types.pxi":923
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Schema.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 923, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":924
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def empty_table(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":921
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":920
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":926
 *             return NotImplemented
 * 
 *     def empty_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Provide an empty table according to the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_18empty_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_17empty_table[] = "Schema.empty_table(self)\n\n        Provide an empty table according to the schema.\n\n        Returns\n        -------\n        table: pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_18empty_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("empty_table (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_17empty_table(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_17empty_table(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("empty_table", 0);

  /* "pyarrow/types.pxi":934
 *         table: pyarrow.Table
 *         """
 *         arrays = []             # <<<<<<<<<<<<<<
 *         names = []
 *         for field in self:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":935
 *         """
 *         arrays = []
 *         names = []             # <<<<<<<<<<<<<<
 *         for field in self:
 *             arrays.append(array([], type=field.type))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":936
 *         arrays = []
 *         names = []
 *         for field in self:             # <<<<<<<<<<<<<<
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 */
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
    __pyx_t_1 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 936, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 936, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 936, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 936, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 936, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 936, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":937
 *         names = []
 *         for field in self:
 *             arrays.append(array([], type=field.type))             # <<<<<<<<<<<<<<
 *             names.append(field.name)
 *         return Table.from_arrays(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_t_7) < 0) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_arrays, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 937, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":938
 *         for field in self:
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)             # <<<<<<<<<<<<<<
 *         return Table.from_arrays(
 *             arrays=arrays,
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_names, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 938, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":936
 *         arrays = []
 *         names = []
 *         for field in self:             # <<<<<<<<<<<<<<
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":939
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 *         return Table.from_arrays(             # <<<<<<<<<<<<<<
 *             arrays=arrays,
 *             names=names,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":940
 *             names.append(field.name)
 *         return Table.from_arrays(
 *             arrays=arrays,             # <<<<<<<<<<<<<<
 *             names=names,
 *             metadata=self.metadata
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_arrays, __pyx_v_arrays) < 0) __PYX_ERR(4, 940, __pyx_L1_error)

  /* "pyarrow/types.pxi":941
 *         return Table.from_arrays(
 *             arrays=arrays,
 *             names=names,             # <<<<<<<<<<<<<<
 *             metadata=self.metadata
 *         )
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(4, 940, __pyx_L1_error)

  /* "pyarrow/types.pxi":942
 *             arrays=arrays,
 *             names=names,
 *             metadata=self.metadata             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_metadata, __pyx_t_5) < 0) __PYX_ERR(4, 940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":939
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 *         return Table.from_arrays(             # <<<<<<<<<<<<<<
 *             arrays=arrays,
 *             names=names,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":926
 *             return NotImplemented
 * 
 *     def empty_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Provide an empty table according to the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Schema.empty_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":945
 *         )
 * 
 *     def equals(self, Schema other not None, bint check_metadata=True):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this schema is equal to the other
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_20equals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_19equals[] = "Schema.equals(self, Schema other, bool check_metadata=True)\n\n        Test if this schema is equal to the other\n\n        Parameters\n        ----------\n        other :  pyarrow.Schema\n        check_metadata : bool, default False\n            Key/value metadata must be equal too\n\n        Returns\n        -------\n        is_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_20equals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_other = 0;
  int __pyx_v_check_metadata;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_check_metadata,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_check_metadata);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) __PYX_ERR(4, 945, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    if (values[1]) {
      __pyx_v_check_metadata = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_check_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 945, __pyx_L3_error)
    } else {
      __pyx_v_check_metadata = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 945, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.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_ptype_7pyarrow_3lib_Schema, 0, "other", 0))) __PYX_ERR(4, 945, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_19equals(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_other, __pyx_v_check_metadata);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_19equals(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_other, int __pyx_v_check_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/types.pxi":959
 *         is_equal : boolean
 *         """
 *         return self.sp_schema.get().Equals(deref(other.schema),             # <<<<<<<<<<<<<<
 *                                            check_metadata)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/types.pxi":960
 *         """
 *         return self.sp_schema.get().Equals(deref(other.schema),
 *                                            check_metadata)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->sp_schema.get()->Equals((*__pyx_v_other->schema), __pyx_v_check_metadata)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":945
 *         )
 * 
 *     def equals(self, Schema other not None, bint check_metadata=True):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this schema is equal to the other
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":963
 * 
 *     @classmethod
 *     def from_pandas(cls, df, preserve_index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_21from_pandas[] = "Schema.from_pandas(type cls, df, preserve_index=None)\n\n        Returns implied schema from dataframe\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        preserve_index : bool, default True\n            Whether to store the index as an additional column (or columns, for\n            MultiIndex) in the resulting `Table`.\n            The default of None will store the index as a column, except for\n            RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n\n        Returns\n        -------\n        pyarrow.Schema\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Schema.from_pandas(df)\n        int: int64\n        str: string\n        __index_level_0__: int64\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  PyObject *__pyx_v_preserve_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_preserve_index,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_index);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(4, 963, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    __pyx_v_preserve_index = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 963, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_21from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_preserve_index);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_21from_pandas(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, PyObject *__pyx_v_preserve_index) {
  PyObject *__pyx_v_dataframe_to_types = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_types = NULL;
  PyObject *__pyx_v_metadata = NULL;
  PyObject *__pyx_v_fields = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "pyarrow/types.pxi":995
 *         __index_level_0__: int64
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types             # <<<<<<<<<<<<<<
 *         names, types, metadata = dataframe_to_types(
 *             df,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_types);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_types);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_types);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_types = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":996
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types
 *         names, types, metadata = dataframe_to_types(             # <<<<<<<<<<<<<<
 *             df,
 *             preserve_index=preserve_index
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);

  /* "pyarrow/types.pxi":998
 *         names, types, metadata = dataframe_to_types(
 *             df,
 *             preserve_index=preserve_index             # <<<<<<<<<<<<<<
 *         )
 *         fields = []
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_preserve_index, __pyx_v_preserve_index) < 0) __PYX_ERR(4, 998, __pyx_L1_error)

  /* "pyarrow/types.pxi":996
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types
 *         names, types, metadata = dataframe_to_types(             # <<<<<<<<<<<<<<
 *             df,
 *             preserve_index=preserve_index
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_types, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 996, __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 996, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(4, 996, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 996, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_types = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_metadata = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1000
 *             preserve_index=preserve_index
 *         )
 *         fields = []             # <<<<<<<<<<<<<<
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_fields = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1001
 *         )
 *         fields = []
 *         for name, type_ in zip(names, types):             # <<<<<<<<<<<<<<
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_GIVEREF(__pyx_v_names);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_names);
  __Pyx_INCREF(__pyx_v_types);
  __Pyx_GIVEREF(__pyx_v_types);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_types);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1001, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 1001, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1001, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 1001, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1001, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1001, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 1001, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(4, 1001, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1001, __pyx_L1_error)
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1002
 *         fields = []
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))             # <<<<<<<<<<<<<<
 *         return schema(fields, metadata)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_type_};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1002, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_type_};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1002, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1002, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_type_);
      __Pyx_GIVEREF(__pyx_v_type_);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_type_);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1002, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(4, 1002, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":1001
 *         )
 *         fields = []
 *         for name, type_ in zip(names, types):             # <<<<<<<<<<<<<<
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1003
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)             # <<<<<<<<<<<<<<
 * 
 *     def field(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fields, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1003, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fields, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1003, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_fields);
    __Pyx_GIVEREF(__pyx_v_fields);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_fields);
    __Pyx_INCREF(__pyx_v_metadata);
    __Pyx_GIVEREF(__pyx_v_metadata);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_metadata);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":963
 * 
 *     @classmethod
 *     def from_pandas(cls, df, preserve_index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */

  /* 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.lib.Schema.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dataframe_to_types);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_types);
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1005
 *         return schema(fields, metadata)
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a field by its column name or numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_24field(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_23field[] = "Schema.field(self, i)\n\n        Select a field by its column name or numeric index.\n\n        Parameters\n        ----------\n        i : int or string\n\n        Returns\n        -------\n        pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_24field(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_23field(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_23field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_v_field_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":1017
 *         pyarrow.Field
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1018
 *         """
 *         if isinstance(i, six.string_types):
 *             field_index = self.get_field_index(i)             # <<<<<<<<<<<<<<
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_field_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_field_index = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1019
 *         if isinstance(i, six.string_types):
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_field_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":1020
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in schema".format(i))             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._field(field_index)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_does_not_exist_in_schema, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(4, 1020, __pyx_L1_error)

      /* "pyarrow/types.pxi":1019
 *         if isinstance(i, six.string_types):
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 *             else:
 */
    }

    /* "pyarrow/types.pxi":1022
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 *             else:
 *                 return self._field(field_index)             # <<<<<<<<<<<<<<
 *         elif isinstance(i, six.integer_types):
 *             return self._field(i)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_field_index) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_field_index);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1022, __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/types.pxi":1017
 *         pyarrow.Field
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:
 */
  }

  /* "pyarrow/types.pxi":1023
 *             else:
 *                 return self._field(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._field(i)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 1023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/types.pxi":1024
 *                 return self._field(field_index)
 *         elif isinstance(i, six.integer_types):
 *             return self._field(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Index must either be string or integer")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1024, __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/types.pxi":1023
 *             else:
 *                 return self._field(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._field(i)
 *         else:
 */
  }

  /* "pyarrow/types.pxi":1026
 *             return self._field(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _field(self, int i):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1026, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":1005
 *         return schema(fields, metadata)
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a field by its column name or numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_field_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1028
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _field(self, int i):             # <<<<<<<<<<<<<<
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_26_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_25_field[] = "Schema._field(self, int i)\nSelect a field by its numeric index.";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_26_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_field (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1028, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema._field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_25_field(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((int)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_25_field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_field", 0);

  /* "pyarrow/types.pxi":1030
 *     def _field(self, int i):
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_v_self->schema->num_fields()); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(4, 1030, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_1);

  /* "pyarrow/types.pxi":1031
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())
 *         return pyarrow_wrap_field(self.schema.field(index))             # <<<<<<<<<<<<<<
 * 
 *     def field_by_name(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->schema->field(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1028
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _field(self, int i):             # <<<<<<<<<<<<<<
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Schema._field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1033
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 *     def field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Access a field by its name rather than the column index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_28field_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_27field_by_name[] = "Schema.field_by_name(self, name)\n\n        Access a field by its name rather than the column index.\n\n        Parameters\n        ----------\n        name: str\n\n        Returns\n        -------\n        field: pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_28field_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field_by_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_27field_by_name(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_27field_by_name(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_results;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("field_by_name", 0);

  /* "pyarrow/types.pxi":1048
 *             vector[shared_ptr[CField]] results
 * 
 *         warnings.warn(             # <<<<<<<<<<<<<<
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1050
 *         warnings.warn(
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(4, 1050, __pyx_L1_error)

  /* "pyarrow/types.pxi":1048
 *             vector[shared_ptr[CField]] results
 * 
 *         warnings.warn(             # <<<<<<<<<<<<<<
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1048, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1052
 *             FutureWarning, stacklevel=2)
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))             # <<<<<<<<<<<<<<
 *         if results.size() == 0:
 *             return None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1052, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_results = __pyx_v_self->schema->GetAllFieldsByName(__pyx_t_4);

  /* "pyarrow/types.pxi":1053
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:             # <<<<<<<<<<<<<<
 *             return None
 *         elif results.size() > 1:
 */
  __pyx_t_5 = ((__pyx_v_results.size() == 0) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1054
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:
 *             return None             # <<<<<<<<<<<<<<
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1053
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:             # <<<<<<<<<<<<<<
 *             return None
 *         elif results.size() > 1:
 */
  }

  /* "pyarrow/types.pxi":1055
 *         if results.size() == 0:
 *             return None
 *         elif results.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  __pyx_t_5 = ((__pyx_v_results.size() > 1) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1056
 *             return None
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             return None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1057
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1058
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_field(results[0])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1055
 *         if results.size() == 0:
 *             return None
 *         elif results.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  }

  /* "pyarrow/types.pxi":1060
 *             return None
 *         else:
 *             return pyarrow_wrap_field(results[0])             # <<<<<<<<<<<<<<
 * 
 *     def get_field_index(self, name):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field((__pyx_v_results[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":1033
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 *     def field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Access a field by its name rather than the column index.
 */

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

/* "pyarrow/types.pxi":1062
 *             return pyarrow_wrap_field(results[0])
 * 
 *     def get_field_index(self, name):             # <<<<<<<<<<<<<<
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_30get_field_index(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_29get_field_index[] = "Schema.get_field_index(self, name)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_30get_field_index(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_field_index (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_29get_field_index(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_29get_field_index(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __Pyx_RefNannySetupContext("get_field_index", 0);

  /* "pyarrow/types.pxi":1063
 * 
 *     def get_field_index(self, name):
 *         return self.schema.GetFieldIndex(tobytes(name))             # <<<<<<<<<<<<<<
 * 
 *     def append(self, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->schema->GetFieldIndex(__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1062
 *             return pyarrow_wrap_field(results[0])
 * 
 *     def get_field_index(self, name):             # <<<<<<<<<<<<<<
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 */

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

/* "pyarrow/types.pxi":1065
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 *     def append(self, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Append a field at the end of the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_32append(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_31append[] = "Schema.append(self, Field field)\n\n        Append a field at the end of the schema.\n\n        In contrast to Python's ``list.append()`` it does return a new\n        object, leaving the original Schema unmodified.\n\n        Parameters\n        ----------\n        field: Field\n\n        Returns\n        -------\n        schema: Schema\n            New object with appended field.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_32append(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 1065, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_31append(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_field));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_31append(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("append", 0);

  /* "pyarrow/types.pxi":1081
 *             New object with appended field.
 *         """
 *         return self.insert(self.schema.num_fields(), field)             # <<<<<<<<<<<<<<
 * 
 *     def insert(self, int i, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->schema->num_fields()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_field)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1081, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_field)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1081, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_field));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_field));
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_field));
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1065
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 *     def append(self, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Append a field at the end of the schema.
 */

  /* 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.lib.Schema.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1083
 *         return self.insert(self.schema.num_fields(), field)
 * 
 *     def insert(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Add a field at position i to the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_34insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_33insert[] = "Schema.insert(self, int i, Field field)\n\n        Add a field at position i to the schema.\n\n        Parameters\n        ----------\n        i: int\n        field: Field\n\n        Returns\n        -------\n        schema: Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_34insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(4, 1083, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(4, 1083, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1083, __pyx_L3_error)
    __pyx_v_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1083, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 1083, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_33insert(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_i, __pyx_v_field);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_33insert(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  std::shared_ptr< arrow::Field>  __pyx_v_c_field;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Field>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);

  /* "pyarrow/types.pxi":1100
 *             shared_ptr[CField] c_field
 * 
 *         c_field = field.sp_field             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_v_field->sp_field;
  __pyx_v_c_field = __pyx_t_1;

  /* "pyarrow/types.pxi":1102
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.AddField(i, c_field, &new_schema))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1103
 * 
 *         with nogil:
 *             check_status(self.schema.AddField(i, c_field, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->AddField(__pyx_v_i, __pyx_v_c_field, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1103, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1102
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.AddField(i, c_field, &new_schema))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1105
 *             check_status(self.schema.AddField(i, c_field, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def remove(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1083
 *         return self.insert(self.schema.num_fields(), field)
 * 
 *     def insert(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Add a field at position i to the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1107
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def remove(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Remove the field at index i from the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_36remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_35remove[] = "Schema.remove(self, int i)\n\n        Remove the field at index i from the schema.\n\n        Parameters\n        ----------\n        i: int\n\n        Returns\n        -------\n        schema: Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_36remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1107, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_35remove(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((int)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_35remove(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("remove", 0);

  /* "pyarrow/types.pxi":1121
 *         cdef shared_ptr[CSchema] new_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.RemoveField(i, &new_schema))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1122
 * 
 *         with nogil:
 *             check_status(self.schema.RemoveField(i, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->RemoveField(__pyx_v_i, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1122, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1121
 *         cdef shared_ptr[CSchema] new_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.RemoveField(i, &new_schema))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1124
 *             check_status(self.schema.RemoveField(i, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def set(self, int i, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1107
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def remove(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Remove the field at index i from the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Schema.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1126
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def set(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Replace a field at position i in the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_38set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_37set[] = "Schema.set(self, int i, Field field)\n\n        Replace a field at position i in the schema.\n\n        Parameters\n        ----------\n        i: int\n        field: Field\n\n        Returns\n        -------\n        schema: Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_38set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(4, 1126, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(4, 1126, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1126, __pyx_L3_error)
    __pyx_v_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1126, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 1126, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_37set(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_i, __pyx_v_field);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_37set(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  std::shared_ptr< arrow::Field>  __pyx_v_c_field;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Field>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("set", 0);

  /* "pyarrow/types.pxi":1143
 *             shared_ptr[CField] c_field
 * 
 *         c_field = field.sp_field             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_v_field->sp_field;
  __pyx_v_c_field = __pyx_t_1;

  /* "pyarrow/types.pxi":1145
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1146
 * 
 *         with nogil:
 *             check_status(self.schema.SetField(i, c_field, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->SetField(__pyx_v_i, __pyx_v_c_field, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1146, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1145
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1148
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1126
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def set(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Replace a field at position i in the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1150
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_40add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_39add_metadata[] = "Schema.add_metadata(self, metadata)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_40add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_39add_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_39add_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":1151
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1152
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 *         return self.with_metadata(metadata)
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(4, 1152, __pyx_L1_error)

  /* "pyarrow/types.pxi":1151
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1151, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1153
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     def with_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_with_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_metadata) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_metadata);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1153, __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/types.pxi":1150
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

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

/* "pyarrow/types.pxi":1155
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_42with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_41with_metadata[] = "Schema.with_metadata(self, metadata)\n\n        Add metadata as dict of string keys and values to Schema\n\n        Parameters\n        ----------\n        metadata : dict\n            Keys and values must be string-like / coercible to bytes\n\n        Returns\n        -------\n        schema : pyarrow.Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_42with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("with_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_41with_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_41with_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("with_metadata", 0);

  /* "pyarrow/types.pxi":1172
 *             shared_ptr[CSchema] c_schema
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_metadata); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1173
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1173, __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(4, 1173, __pyx_L1_error)

    /* "pyarrow/types.pxi":1172
 *             shared_ptr[CSchema] c_schema
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  }

  /* "pyarrow/types.pxi":1175
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             c_schema = self.schema.WithMetadata(c_meta)
 */
  __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

  /* "pyarrow/types.pxi":1176
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_schema = self.schema.WithMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1177
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:
 *             c_schema = self.schema.WithMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(c_schema)
 */
        __pyx_v_c_schema = __pyx_v_self->schema->WithMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":1176
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_schema = self.schema.WithMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":1179
 *             c_schema = self.schema.WithMetadata(c_meta)
 * 
 *         return pyarrow_wrap_schema(c_schema)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_c_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1155
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.with_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1181
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write Schema to Buffer as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_44serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_43serialize[] = "Schema.serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None)\n\n        Write Schema to Buffer as encapsulated IPC message\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n        dictionary_memo : DictionaryMemo, optional\n            If schema contains dictionaries, must pass a\n            DictionaryMemo to be able to deserialize RecordBatch\n            objects\n\n        Returns\n        -------\n        serialized : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_44serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dictionary_memo,&__pyx_n_s_memory_pool,0};
    PyObject* values[2] = {0,0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary_memo);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(4, 1181, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dictionary_memo = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)values[0]);
    __pyx_v_memory_pool = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1181, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dictionary_memo), __pyx_ptype_7pyarrow_3lib_DictionaryMemo, 1, "dictionary_memo", 0))) __PYX_ERR(4, 1181, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_43serialize(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_dictionary_memo, __pyx_v_memory_pool);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_43serialize(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo, PyObject *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buffer;
   arrow::MemoryPool *__pyx_v_pool;
   arrow::ipc::DictionaryMemo __pyx_v_temp_memo;
   arrow::ipc::DictionaryMemo *__pyx_v_arg_dict_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
   arrow::ipc::DictionaryMemo *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/types.pxi":1200
 *         cdef:
 *             shared_ptr[CBuffer] buffer
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *             CDictionaryMemo temp_memo
 *             CDictionaryMemo* arg_dict_memo
 */
  if (!(likely(((__pyx_v_memory_pool) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_memory_pool, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(4, 1200, __pyx_L1_error)
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_memory_pool));

  /* "pyarrow/types.pxi":1204
 *             CDictionaryMemo* arg_dict_memo
 * 
 *         if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *             arg_dict_memo = dictionary_memo.memo
 *         else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_dictionary_memo) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":1205
 * 
 *         if dictionary_memo is not None:
 *             arg_dict_memo = dictionary_memo.memo             # <<<<<<<<<<<<<<
 *         else:
 *             arg_dict_memo = &temp_memo
 */
    __pyx_t_3 = __pyx_v_dictionary_memo->memo;
    __pyx_v_arg_dict_memo = __pyx_t_3;

    /* "pyarrow/types.pxi":1204
 *             CDictionaryMemo* arg_dict_memo
 * 
 *         if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *             arg_dict_memo = dictionary_memo.memo
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1207
 *             arg_dict_memo = dictionary_memo.memo
 *         else:
 *             arg_dict_memo = &temp_memo             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_v_arg_dict_memo = (&__pyx_v_temp_memo);
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1209
 *             arg_dict_memo = &temp_memo
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,
 *                                          pool, &buffer))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1210
 * 
 *         with nogil:
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,             # <<<<<<<<<<<<<<
 *                                          pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::SerializeSchema((*__pyx_v_self->schema), __pyx_v_arg_dict_memo, __pyx_v_pool, (&__pyx_v_buffer))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 1210, __pyx_L5_error)
      }

      /* "pyarrow/types.pxi":1209
 *             arg_dict_memo = &temp_memo
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,
 *                                          pool, &buffer))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":1212
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,
 *                                          pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)             # <<<<<<<<<<<<<<
 * 
 *     def remove_metadata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1181
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write Schema to Buffer as encapsulated IPC message
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1214
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new schema without metadata, if any
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_46remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_45remove_metadata[] = "Schema.remove_metadata(self)\n\n        Create new schema without metadata, if any\n\n        Returns\n        -------\n        schema : pyarrow.Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_46remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_45remove_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_45remove_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("remove_metadata", 0);

  /* "pyarrow/types.pxi":1223
 *         """
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_schema = self.schema.RemoveMetadata()
 *         return pyarrow_wrap_schema(new_schema)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1224
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:
 *             new_schema = self.schema.RemoveMetadata()             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(new_schema)
 * 
 */
        __pyx_v_new_schema = __pyx_v_self->schema->RemoveMetadata();
      }

      /* "pyarrow/types.pxi":1223
 *         """
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_schema = self.schema.RemoveMetadata()
 *         return pyarrow_wrap_schema(new_schema)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1225
 *         with nogil:
 *             new_schema = self.schema.RemoveMetadata()
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1214
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new schema without metadata, if any
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.remove_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1227
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_48__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_48__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_47__str__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_47__str__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  std::string __pyx_v_result;
  PyObject *__pyx_v_printed = NULL;
  PyObject *__pyx_v_pprint = NULL;
  PyObject *__pyx_v_metadata_formatted = 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;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/types.pxi":1231
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1232
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.schema),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->schema), arrow::PrettyPrintOptions(0), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1232, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1231
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1240
 *             )
 * 
 *         printed = frombytes(result)             # <<<<<<<<<<<<<<
 *         if self.metadata is not None:
 *             import pprint
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_printed = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1241
 * 
 *         printed = frombytes(result)
 *         if self.metadata is not None:             # <<<<<<<<<<<<<<
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "pyarrow/types.pxi":1242
 *         printed = frombytes(result)
 *         if self.metadata is not None:
 *             import pprint             # <<<<<<<<<<<<<<
 *             metadata_formatted = pprint.pformat(self.metadata)
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 */
    __pyx_t_2 = __Pyx_Import(__pyx_n_s_pprint, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_pprint = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1243
 *         if self.metadata is not None:
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)             # <<<<<<<<<<<<<<
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pprint, __pyx_n_s_pformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_metadata_formatted = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1244
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 *             printed += '\nmetadata\n--------\n' + metadata_formatted             # <<<<<<<<<<<<<<
 * 
 *         return printed
 */
    __pyx_t_2 = PyNumber_Add(__pyx_kp_u_metadata_2, __pyx_v_metadata_formatted); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_printed, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_printed, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1241
 * 
 *         printed = frombytes(result)
 *         if self.metadata is not None:             # <<<<<<<<<<<<<<
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 */
  }

  /* "pyarrow/types.pxi":1246
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 * 
 *         return printed             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_printed);
  __pyx_r = __pyx_v_printed;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1227
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_printed);
  __Pyx_XDECREF(__pyx_v_pprint);
  __Pyx_XDECREF(__pyx_v_metadata_formatted);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1248
 *         return printed
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_50__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_50__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_49__repr__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_49__repr__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/types.pxi":1249
 * 
 *     def __repr__(self):
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1249, __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/types.pxi":1248
 *         return printed
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

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

/* "pyarrow/types.pxi":1255
 * 
 * 
 * cdef DataType primitive_type(Type type):             # <<<<<<<<<<<<<<
 *     if type in _type_cache:
 *         return _type_cache[type]
 */

static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_primitive_type(enum  arrow::Type::type __pyx_v_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_out = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("primitive_type", 0);

  /* "pyarrow/types.pxi":1256
 * 
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:             # <<<<<<<<<<<<<<
 *         return _type_cache[type]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1256, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_7pyarrow_3lib__type_cache, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1257
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:
 *         return _type_cache[type]             # <<<<<<<<<<<<<<
 * 
 *     cdef DataType out = DataType.__new__(DataType)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1257, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__type_cache, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1257, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1256
 * 
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:             # <<<<<<<<<<<<<<
 *         return _type_cache[type]
 * 
 */
  }

  /* "pyarrow/types.pxi":1259
 *         return _type_cache[type]
 * 
 *     cdef DataType out = DataType.__new__(DataType)             # <<<<<<<<<<<<<<
 *     out.init(GetPrimitiveType(type))
 * 
 */
  __pyx_t_4 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DataType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DataType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1259, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1260
 * 
 *     cdef DataType out = DataType.__new__(DataType)
 *     out.init(GetPrimitiveType(type))             # <<<<<<<<<<<<<<
 * 
 *     _type_cache[type] = out
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_DataType *)__pyx_v_out->__pyx_vtab)->init(__pyx_v_out, arrow::py::GetPrimitiveType(__pyx_v_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1260, __pyx_L1_error)

  /* "pyarrow/types.pxi":1262
 *     out.init(GetPrimitiveType(type))
 * 
 *     _type_cache[type] = out             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1262, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__type_cache, __pyx_t_4, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1263
 * 
 *     _type_cache[type] = out
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1255
 * 
 * 
 * cdef DataType primitive_type(Type type):             # <<<<<<<<<<<<<<
 *     if type in _type_cache:
 *         return _type_cache[type]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.primitive_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1270
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_25field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24field[] = "field(name, type, bool nullable=True, metadata=None)\n\n    Create a pyarrow.Field instance\n\n    Parameters\n    ----------\n    name : string or bytes\n    type : pyarrow.DataType\n    nullable : boolean, default True\n    metadata : dict, default None\n        Keys and values must be coercible to bytes\n\n    Returns\n    -------\n    field : pyarrow.Field\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_25field = {"field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_25field, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_24field};
static PyObject *__pyx_pw_7pyarrow_3lib_25field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_type = 0;
  int __pyx_v_nullable;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_type,&__pyx_n_s_nullable,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("field", 0, 2, 4, 1); __PYX_ERR(4, 1270, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nullable);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "field") < 0)) __PYX_ERR(4, 1270, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_type = values[1];
    if (values[2]) {
      __pyx_v_nullable = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_nullable == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1270, __pyx_L3_error)
    } else {
      __pyx_v_nullable = ((int)1);
    }
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("field", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1270, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24field(__pyx_self, __pyx_v_name, __pyx_v_type, __pyx_v_nullable, __pyx_v_metadata);

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

static PyObject *__pyx_pf_7pyarrow_3lib_24field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type, int __pyx_v_nullable, PyObject *__pyx_v_metadata) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__type = 0;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":1287
 *     """
 *     cdef:
 *         Field result = Field.__new__(Field)             # <<<<<<<<<<<<<<
 *         DataType _type = ensure_type(type, allow_none=False)
 *         shared_ptr[CKeyValueMetadata] c_meta
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Field(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Field), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1287, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1288
 *     cdef:
 *         Field result = Field.__new__(Field)
 *         DataType _type = ensure_type(type, allow_none=False)             # <<<<<<<<<<<<<<
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1291
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_3 = (__pyx_v_metadata != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1292
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_4 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/types.pxi":1293
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(4, 1293, __pyx_L1_error)

      /* "pyarrow/types.pxi":1292
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/types.pxi":1294
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     result.sp_field.reset(
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/types.pxi":1291
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/types.pxi":1297
 * 
 *     result.sp_field.reset(
 *         new CField(tobytes(name), _type.sp_type, nullable, c_meta)             # <<<<<<<<<<<<<<
 *     )
 *     result.field = result.sp_field.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1296
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     result.sp_field.reset(             # <<<<<<<<<<<<<<
 *         new CField(tobytes(name), _type.sp_type, nullable, c_meta)
 *     )
 */
  __pyx_v_result->sp_field.reset(new  arrow::Field(__pyx_t_7, __pyx_v__type->sp_type, __pyx_v_nullable, __pyx_v_c_meta));

  /* "pyarrow/types.pxi":1299
 *         new CField(tobytes(name), _type.sp_type, nullable, c_meta)
 *     )
 *     result.field = result.sp_field.get()             # <<<<<<<<<<<<<<
 *     result.type = _type
 * 
 */
  __pyx_v_result->field = __pyx_v_result->sp_field.get();

  /* "pyarrow/types.pxi":1300
 *     )
 *     result.field = result.sp_field.get()
 *     result.type = _type             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __Pyx_INCREF(((PyObject *)__pyx_v__type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v__type));
  __Pyx_GOTREF(__pyx_v_result->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->type));
  __pyx_v_result->type = __pyx_v__type;

  /* "pyarrow/types.pxi":1302
 *     result.type = _type
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1270
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v__type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1319
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_27null(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_26null[] = "null()\n\n    Create instance of null type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_27null = {"null", (PyCFunction)__pyx_pw_7pyarrow_3lib_27null, METH_NOARGS, __pyx_doc_7pyarrow_3lib_26null};
static PyObject *__pyx_pw_7pyarrow_3lib_27null(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("null (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_26null(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_26null(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("null", 0);

  /* "pyarrow/types.pxi":1323
 *     Create instance of null type
 *     """
 *     return primitive_type(_Type_NA)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::NA)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1319
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */

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

/* "pyarrow/types.pxi":1326
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_29bool_(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_28bool_[] = "bool_()\n\n    Create instance of boolean type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_29bool_ = {"bool_", (PyCFunction)__pyx_pw_7pyarrow_3lib_29bool_, METH_NOARGS, __pyx_doc_7pyarrow_3lib_28bool_};
static PyObject *__pyx_pw_7pyarrow_3lib_29bool_(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bool_ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_28bool_(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_28bool_(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("bool_", 0);

  /* "pyarrow/types.pxi":1330
 *     Create instance of boolean type
 *     """
 *     return primitive_type(_Type_BOOL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::BOOL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1326
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */

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

/* "pyarrow/types.pxi":1333
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_31uint8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_30uint8[] = "uint8()\n\n    Create instance of unsigned int8 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_31uint8 = {"uint8", (PyCFunction)__pyx_pw_7pyarrow_3lib_31uint8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_30uint8};
static PyObject *__pyx_pw_7pyarrow_3lib_31uint8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_30uint8(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_30uint8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint8", 0);

  /* "pyarrow/types.pxi":1337
 *     Create instance of unsigned int8 type
 *     """
 *     return primitive_type(_Type_UINT8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1333
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */

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

/* "pyarrow/types.pxi":1340
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_33int8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_32int8[] = "int8()\n\n    Create instance of signed int8 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_33int8 = {"int8", (PyCFunction)__pyx_pw_7pyarrow_3lib_33int8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_32int8};
static PyObject *__pyx_pw_7pyarrow_3lib_33int8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_32int8(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_32int8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int8", 0);

  /* "pyarrow/types.pxi":1344
 *     Create instance of signed int8 type
 *     """
 *     return primitive_type(_Type_INT8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1340
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */

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

/* "pyarrow/types.pxi":1347
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_35uint16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_34uint16[] = "uint16()\n\n    Create instance of unsigned uint16 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_35uint16 = {"uint16", (PyCFunction)__pyx_pw_7pyarrow_3lib_35uint16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_34uint16};
static PyObject *__pyx_pw_7pyarrow_3lib_35uint16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_34uint16(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_34uint16(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint16", 0);

  /* "pyarrow/types.pxi":1351
 *     Create instance of unsigned uint16 type
 *     """
 *     return primitive_type(_Type_UINT16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1347
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */

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

/* "pyarrow/types.pxi":1354
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_37int16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_36int16[] = "int16()\n\n    Create instance of signed int16 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_37int16 = {"int16", (PyCFunction)__pyx_pw_7pyarrow_3lib_37int16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_36int16};
static PyObject *__pyx_pw_7pyarrow_3lib_37int16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_36int16(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_36int16(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int16", 0);

  /* "pyarrow/types.pxi":1358
 *     Create instance of signed int16 type
 *     """
 *     return primitive_type(_Type_INT16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1354
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */

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

/* "pyarrow/types.pxi":1361
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_39uint32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_38uint32[] = "uint32()\n\n    Create instance of unsigned uint32 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_39uint32 = {"uint32", (PyCFunction)__pyx_pw_7pyarrow_3lib_39uint32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_38uint32};
static PyObject *__pyx_pw_7pyarrow_3lib_39uint32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_38uint32(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_38uint32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint32", 0);

  /* "pyarrow/types.pxi":1365
 *     Create instance of unsigned uint32 type
 *     """
 *     return primitive_type(_Type_UINT32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1361
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */

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

/* "pyarrow/types.pxi":1368
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_41int32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_40int32[] = "int32()\n\n    Create instance of signed int32 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_41int32 = {"int32", (PyCFunction)__pyx_pw_7pyarrow_3lib_41int32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_40int32};
static PyObject *__pyx_pw_7pyarrow_3lib_41int32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_40int32(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_40int32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int32", 0);

  /* "pyarrow/types.pxi":1372
 *     Create instance of signed int32 type
 *     """
 *     return primitive_type(_Type_INT32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1368
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */

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

/* "pyarrow/types.pxi":1375
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_43uint64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_42uint64[] = "uint64()\n\n    Create instance of unsigned uint64 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_43uint64 = {"uint64", (PyCFunction)__pyx_pw_7pyarrow_3lib_43uint64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_42uint64};
static PyObject *__pyx_pw_7pyarrow_3lib_43uint64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_42uint64(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_42uint64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint64", 0);

  /* "pyarrow/types.pxi":1379
 *     Create instance of unsigned uint64 type
 *     """
 *     return primitive_type(_Type_UINT64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1375
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */

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

/* "pyarrow/types.pxi":1382
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_45int64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_44int64[] = "int64()\n\n    Create instance of signed int64 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_45int64 = {"int64", (PyCFunction)__pyx_pw_7pyarrow_3lib_45int64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_44int64};
static PyObject *__pyx_pw_7pyarrow_3lib_45int64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_44int64(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_44int64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int64", 0);

  /* "pyarrow/types.pxi":1386
 *     Create instance of signed int64 type
 *     """
 *     return primitive_type(_Type_INT64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1382
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */

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

/* "pyarrow/types.pxi":1393
 * 
 * 
 * cdef timeunit_to_string(TimeUnit unit):             # <<<<<<<<<<<<<<
 *     if unit == TimeUnit_SECOND:
 *         return 's'
 */

static PyObject *__pyx_f_7pyarrow_3lib_timeunit_to_string(enum  arrow::TimeUnit::type __pyx_v_unit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timeunit_to_string", 0);

  /* "pyarrow/types.pxi":1394
 * 
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 */
  switch (__pyx_v_unit) {
    case  arrow::TimeUnit::SECOND:

    /* "pyarrow/types.pxi":1395
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:
 *         return 's'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_s);
    __pyx_r = __pyx_n_u_s;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1394
 * 
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 */
    break;
    case  arrow::TimeUnit::MILLI:

    /* "pyarrow/types.pxi":1397
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ms);
    __pyx_r = __pyx_n_u_ms;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1396
 *     if unit == TimeUnit_SECOND:
 *         return 's'
 *     elif unit == TimeUnit_MILLI:             # <<<<<<<<<<<<<<
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:
 */
    break;
    case  arrow::TimeUnit::MICRO:

    /* "pyarrow/types.pxi":1399
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_NANO:
 *         return 'ns'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_us);
    __pyx_r = __pyx_n_u_us;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1398
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *         return 'us'
 *     elif unit == TimeUnit_NANO:
 */
    break;
    case  arrow::TimeUnit::NANO:

    /* "pyarrow/types.pxi":1401
 *         return 'us'
 *     elif unit == TimeUnit_NANO:
 *         return 'ns'             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ns);
    __pyx_r = __pyx_n_u_ns;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1400
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'
 *     elif unit == TimeUnit_NANO:             # <<<<<<<<<<<<<<
 *         return 'ns'
 * 
 */
    break;
    default: break;
  }

  /* "pyarrow/types.pxi":1393
 * 
 * 
 * cdef timeunit_to_string(TimeUnit unit):             # <<<<<<<<<<<<<<
 *     if unit == TimeUnit_SECOND:
 *         return 's'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1407
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_47tzinfo_to_string(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/
static char __pyx_doc_7pyarrow_3lib_46tzinfo_to_string[] = "tzinfo_to_string(tz)\n\n    Converts a time zone object into a string indicating the name of a time\n    zone, one of:\n    * As used in the Olson time zone database (the \"tz database\" or\n      \"tzdata\"), such as \"America/New_York\"\n    * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30\n\n    Parameters\n    ----------\n      tz : datetime.tzinfo\n        Time zone object\n\n    Returns\n    -------\n      name : string\n        Time zone name\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_47tzinfo_to_string = {"tzinfo_to_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_47tzinfo_to_string, METH_O, __pyx_doc_7pyarrow_3lib_46tzinfo_to_string};
static PyObject *__pyx_pw_7pyarrow_3lib_47tzinfo_to_string(PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tzinfo_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_46tzinfo_to_string(__pyx_self, ((PyObject *)__pyx_v_tz));

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

/* "pyarrow/types.pxi":1428
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string(PyObject *__pyx_self, PyObject *__pyx_v_offset); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string = {"fixed_offset_to_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string, METH_O, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string(PyObject *__pyx_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fixed_offset_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_self, ((PyObject *)__pyx_v_offset));

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

static PyObject *__pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_v_seconds = NULL;
  PyObject *__pyx_v_sign = NULL;
  PyObject *__pyx_v_minutes = NULL;
  PyObject *__pyx_v_hours = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("fixed_offset_to_string", 0);

  /* "pyarrow/types.pxi":1429
 * 
 *     def fixed_offset_to_string(offset):
 *         seconds = int(offset.utcoffset(None).total_seconds())             # <<<<<<<<<<<<<<
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_3, Py_None);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seconds = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1430
 *     def fixed_offset_to_string(offset):
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'             # <<<<<<<<<<<<<<
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_seconds, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1430, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 1430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_kp_u__27);
    __pyx_t_3 = __pyx_kp_u__27;
  } else {
    __Pyx_INCREF(__pyx_kp_u__28);
    __pyx_t_3 = __pyx_kp_u__28;
  }
  __pyx_v_sign = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1431
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)             # <<<<<<<<<<<<<<
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 */
  __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Divmod(__pyx_t_3, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    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(4, 1431, __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_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(4, 1431, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 1431, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_minutes = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_seconds, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1432
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)             # <<<<<<<<<<<<<<
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')
 */
  __pyx_t_1 = PyNumber_Divmod(__pyx_v_minutes, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    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(4, 1432, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(4, 1432, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 1432, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_hours = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_minutes, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1433
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_seconds, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1433, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":1434
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')             # <<<<<<<<<<<<<<
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1434, __pyx_L1_error)

    /* "pyarrow/types.pxi":1433
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 */
  }

  /* "pyarrow/types.pxi":1435
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)             # <<<<<<<<<<<<<<
 * 
 *     if tz is pytz.utc:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_02d_02d, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_sign);
    __Pyx_GIVEREF(__pyx_v_sign);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_sign);
    __Pyx_INCREF(__pyx_v_hours);
    __Pyx_GIVEREF(__pyx_v_hours);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_hours);
    __Pyx_INCREF(__pyx_v_minutes);
    __Pyx_GIVEREF(__pyx_v_minutes);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_minutes);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1428
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */

  /* 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.lib.tzinfo_to_string.fixed_offset_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seconds);
  __Pyx_XDECREF(__pyx_v_sign);
  __Pyx_XDECREF(__pyx_v_minutes);
  __Pyx_XDECREF(__pyx_v_hours);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1407
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

static PyObject *__pyx_pf_7pyarrow_3lib_46tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_v_pytz = NULL;
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_fixed_offset_to_string = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("tzinfo_to_string", 0);

  /* "pyarrow/types.pxi":1425
 *         Time zone name
 *     """
 *     import pytz             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1426
 *     """
 *     import pytz
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     def fixed_offset_to_string(offset):
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1428
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string, 0, __pyx_n_s_tzinfo_to_string_locals_fixed_of, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fixed_offset_to_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1437
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 *     if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_utc); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_tz == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1438
 * 
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1437
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 *     if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 */
  }

  /* "pyarrow/types.pxi":1439
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):             # <<<<<<<<<<<<<<
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_BaseTzInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":1440
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1439
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):             # <<<<<<<<<<<<<<
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 */
  }

  /* "pyarrow/types.pxi":1441
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):             # <<<<<<<<<<<<<<
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_FixedOffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1442
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_v_fixed_offset_to_string, __pyx_v_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1441
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):             # <<<<<<<<<<<<<<
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 */
  }

  /* "pyarrow/types.pxi":1443
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1444
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):             # <<<<<<<<<<<<<<
 *             return fixed_offset_to_string(tz)
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_3 != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (likely(__pyx_t_2)) {

      /* "pyarrow/types.pxi":1445
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_v_fixed_offset_to_string, __pyx_v_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pyarrow/types.pxi":1444
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):             # <<<<<<<<<<<<<<
 *             return fixed_offset_to_string(tz)
 *         else:
 */
    }

    /* "pyarrow/types.pxi":1447
 *             return fixed_offset_to_string(tz)
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'             # <<<<<<<<<<<<<<
 *                              .format(tz))
 *     else:
 */
    /*else*/ {

      /* "pyarrow/types.pxi":1448
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'
 *                              .format(tz))             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_convert_timezone_to_st, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1447
 *             return fixed_offset_to_string(tz)
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'             # <<<<<<<<<<<<<<
 *                              .format(tz))
 *     else:
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1447, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(4, 1447, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1443
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)
 */
  }

  /* "pyarrow/types.pxi":1450
 *                              .format(tz))
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1450, __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(4, 1450, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":1407
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.tzinfo_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_fixed_offset_to_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1453
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_49string_to_tzinfo(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_48string_to_tzinfo[] = "string_to_tzinfo(name)\n\n    Converts a string indicating the name of a time zone into a time zone\n    object, one of:\n    * As used in the Olson time zone database (the \"tz database\" or\n      \"tzdata\"), such as \"America/New_York\"\n    * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30\n\n    Parameters\n    ----------\n      name: string\n        Time zone name\n\n    Returns\n    -------\n      tz : datetime.tzinfo\n        Time zone object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_49string_to_tzinfo = {"string_to_tzinfo", (PyCFunction)__pyx_pw_7pyarrow_3lib_49string_to_tzinfo, METH_O, __pyx_doc_7pyarrow_3lib_48string_to_tzinfo};
static PyObject *__pyx_pw_7pyarrow_3lib_49string_to_tzinfo(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string_to_tzinfo (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_48string_to_tzinfo(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7pyarrow_3lib_48string_to_tzinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_pytz = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_sign = NULL;
  PyObject *__pyx_v_hours = NULL;
  PyObject *__pyx_v_minutes = NULL;
  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 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_RefNannySetupContext("string_to_tzinfo", 0);

  /* "pyarrow/types.pxi":1471
 *         Time zone object
 *     """
 *     import pytz             # <<<<<<<<<<<<<<
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1472
 *     """
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)             # <<<<<<<<<<<<<<
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FIXED_OFFSET_RE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1473
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:             # <<<<<<<<<<<<<<
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1473, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1474
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1             # <<<<<<<<<<<<<<
 *         hours, minutes = map(int, m.group(2, 3))
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__27, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1474, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_t_1 = __pyx_int_1;
    } else {
      __Pyx_INCREF(__pyx_int_neg_1);
      __pyx_t_1 = __pyx_int_neg_1;
    }
    __pyx_v_sign = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1475
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))             # <<<<<<<<<<<<<<
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      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(4, 1475, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(4, 1475, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1475, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_hours = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_minutes = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1476
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))             # <<<<<<<<<<<<<<
 *     else:
 *         return pytz.timezone(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_FixedOffset_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_hours, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_minutes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_sign, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1476, __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/types.pxi":1473
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:             # <<<<<<<<<<<<<<
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 */
  }

  /* "pyarrow/types.pxi":1478
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 *         return pytz.timezone(name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1478, __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/types.pxi":1453
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */

  /* 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.lib.string_to_tzinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_sign);
  __Pyx_XDECREF(__pyx_v_hours);
  __Pyx_XDECREF(__pyx_v_minutes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1481
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_51timestamp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_50timestamp[] = "timestamp(unit, tz=None)\n\n    Create instance of timestamp type with resolution and optional time zone\n\n    Parameters\n    ----------\n    unit : string\n        one of 's' [second], 'ms' [millisecond], 'us' [microsecond], or 'ns'\n        [nanosecond]\n    tz : string, default None\n        Time zone name. None indicates time zone naive\n\n    Examples\n    --------\n    ::\n\n        t1 = pa.timestamp('us')\n        t2 = pa.timestamp('s', tz='America/New_York')\n\n    Returns\n    -------\n    timestamp_type : TimestampType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_51timestamp = {"timestamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_51timestamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_50timestamp};
static PyObject *__pyx_pw_7pyarrow_3lib_51timestamp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timestamp (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_tz,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timestamp") < 0)) __PYX_ERR(4, 1481, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_unit = values[0];
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timestamp", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1481, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_50timestamp(__pyx_self, __pyx_v_unit, __pyx_v_tz);

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

static PyObject *__pyx_pf_7pyarrow_3lib_50timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_tz) {
  enum  arrow::TimeUnit::type __pyx_v_unit_code;
  std::string __pyx_v_c_timezone;
  struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("timestamp", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "pyarrow/types.pxi":1508
 *         c_string c_timezone
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1508, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1509
 * 
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND             # <<<<<<<<<<<<<<
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 */
    __pyx_v_unit_code =  arrow::TimeUnit::SECOND;

    /* "pyarrow/types.pxi":1508
 *         c_string c_timezone
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1510
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1510, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1511
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI             # <<<<<<<<<<<<<<
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MILLI;

    /* "pyarrow/types.pxi":1510
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1512
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1512, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1513
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO             # <<<<<<<<<<<<<<
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MICRO;

    /* "pyarrow/types.pxi":1512
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1514
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1514, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1515
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Invalid TimeUnit string')
 */
    __pyx_v_unit_code =  arrow::TimeUnit::NANO;

    /* "pyarrow/types.pxi":1514
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1517
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit string')             # <<<<<<<<<<<<<<
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1517, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1519
 *         raise ValueError('Invalid TimeUnit string')
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)             # <<<<<<<<<<<<<<
 * 
 *     if tz is None:
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_TimestampType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_TimestampType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1519, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1521
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 * 
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1522
 * 
 *     if tz is None:
 *         out.init(ctimestamp(unit_code))             # <<<<<<<<<<<<<<
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]
 */
    ((struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::timestamp(__pyx_v_unit_code)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1522, __pyx_L1_error)

    /* "pyarrow/types.pxi":1523
 *     if tz is None:
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:             # <<<<<<<<<<<<<<
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out
 */
    __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(4, 1523, __pyx_L1_error)
    }
    __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_v_7pyarrow_3lib__timestamp_type_cache, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1523, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = (__pyx_t_3 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/types.pxi":1524
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]             # <<<<<<<<<<<<<<
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 1524, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__timestamp_type_cache, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "pyarrow/types.pxi":1523
 *     if tz is None:
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:             # <<<<<<<<<<<<<<
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out
 */
    }

    /* "pyarrow/types.pxi":1525
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 *     else:
 *         if not isinstance(tz, six.string_types):
 */
    if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1525, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__timestamp_type_cache, __pyx_t_4, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":1521
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 * 
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/types.pxi":1527
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 *         if not isinstance(tz, six.string_types):             # <<<<<<<<<<<<<<
 *             tz = tzinfo_to_string(tz)
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_3) {

      /* "pyarrow/types.pxi":1528
 *     else:
 *         if not isinstance(tz, six.string_types):
 *             tz = tzinfo_to_string(tz)             # <<<<<<<<<<<<<<
 * 
 *         c_timezone = tobytes(tz)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tzinfo_to_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pyarrow/types.pxi":1527
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 *         if not isinstance(tz, six.string_types):             # <<<<<<<<<<<<<<
 *             tz = tzinfo_to_string(tz)
 * 
 */
    }

    /* "pyarrow/types.pxi":1530
 *             tz = tzinfo_to_string(tz)
 * 
 *         c_timezone = tobytes(tz)             # <<<<<<<<<<<<<<
 *         out.init(ctimestamp(unit_code, c_timezone))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1530, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_c_timezone = __pyx_t_6;

    /* "pyarrow/types.pxi":1531
 * 
 *         c_timezone = tobytes(tz)
 *         out.init(ctimestamp(unit_code, c_timezone))             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
    ((struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::timestamp(__pyx_v_unit_code, __pyx_v_c_timezone)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1531, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "pyarrow/types.pxi":1533
 *         out.init(ctimestamp(unit_code, c_timezone))
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1481
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1536
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_53time32(PyObject *__pyx_self, PyObject *__pyx_v_unit); /*proto*/
static char __pyx_doc_7pyarrow_3lib_52time32[] = "time32(unit)\n\n    Create instance of 32-bit time (time of day) type with unit resolution\n\n    Parameters\n    ----------\n    unit : string\n        one of 's' [second], or 'ms' [millisecond]\n\n    Examples\n    --------\n    ::\n\n        t1 = pa.time32('s')\n        t2 = pa.time32('ms')\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_53time32 = {"time32", (PyCFunction)__pyx_pw_7pyarrow_3lib_53time32, METH_O, __pyx_doc_7pyarrow_3lib_52time32};
static PyObject *__pyx_pw_7pyarrow_3lib_53time32(PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_52time32(__pyx_self, ((PyObject *)__pyx_v_unit));

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

static PyObject *__pyx_pf_7pyarrow_3lib_52time32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  enum  arrow::TimeUnit::type __pyx_v_unit_code;
  struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_out = 0;
  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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("time32", 0);

  /* "pyarrow/types.pxi":1556
 *         c_string c_timezone
 * 
 *     if unit == 's':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1556, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1557
 * 
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND             # <<<<<<<<<<<<<<
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 */
    __pyx_v_unit_code =  arrow::TimeUnit::SECOND;

    /* "pyarrow/types.pxi":1556
 *         c_string c_timezone
 * 
 *     if unit == 's':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1558
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1558, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1559
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MILLI;

    /* "pyarrow/types.pxi":1558
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1561
 *         unit_code = TimeUnit_MILLI
 *     else:
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))             # <<<<<<<<<<<<<<
 * 
 *     if unit_code in _time_type_cache:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_TimeUnit_for_time32, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_unit) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_unit);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1561, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1563
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1563, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_7pyarrow_3lib__time_type_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1564
 * 
 *     if unit_code in _time_type_cache:
 *         return _time_type_cache[unit_code]             # <<<<<<<<<<<<<<
 * 
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1564, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1564, __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/types.pxi":1563
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1566
 *         return _time_type_cache[unit_code]
 * 
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)             # <<<<<<<<<<<<<<
 * 
 *     out.init(ctime32(unit_code))
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Time32Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Time32Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1566, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Time32Type *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1568
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)
 * 
 *     out.init(ctime32(unit_code))             # <<<<<<<<<<<<<<
 *     _time_type_cache[unit_code] = out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::time32(__pyx_v_unit_code)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1568, __pyx_L1_error)

  /* "pyarrow/types.pxi":1569
 * 
 *     out.init(ctime32(unit_code))
 *     _time_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1569, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_2, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1571
 *     _time_type_cache[unit_code] = out
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1536
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.time32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1574
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_55time64(PyObject *__pyx_self, PyObject *__pyx_v_unit); /*proto*/
static char __pyx_doc_7pyarrow_3lib_54time64[] = "time64(unit)\n\n    Create instance of 64-bit time (time of day) type with unit resolution\n\n    Parameters\n    ----------\n    unit : string\n        one of 'us' [microsecond], or 'ns' [nanosecond]\n\n    Examples\n    --------\n    ::\n\n        t1 = pa.time64('us')\n        t2 = pa.time64('ns')\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_55time64 = {"time64", (PyCFunction)__pyx_pw_7pyarrow_3lib_55time64, METH_O, __pyx_doc_7pyarrow_3lib_54time64};
static PyObject *__pyx_pw_7pyarrow_3lib_55time64(PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_54time64(__pyx_self, ((PyObject *)__pyx_v_unit));

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

static PyObject *__pyx_pf_7pyarrow_3lib_54time64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  enum  arrow::TimeUnit::type __pyx_v_unit_code;
  struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_out = 0;
  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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("time64", 0);

  /* "pyarrow/types.pxi":1594
 *         c_string c_timezone
 * 
 *     if unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1594, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1595
 * 
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO             # <<<<<<<<<<<<<<
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MICRO;

    /* "pyarrow/types.pxi":1594
 *         c_string c_timezone
 * 
 *     if unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1596
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1596, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1597
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 */
    __pyx_v_unit_code =  arrow::TimeUnit::NANO;

    /* "pyarrow/types.pxi":1596
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1599
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))             # <<<<<<<<<<<<<<
 * 
 *     if unit_code in _time_type_cache:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_TimeUnit_for_time64, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_unit) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_unit);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1599, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1601
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1601, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_7pyarrow_3lib__time_type_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1601, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1602
 * 
 *     if unit_code in _time_type_cache:
 *         return _time_type_cache[unit_code]             # <<<<<<<<<<<<<<
 * 
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1602, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1602, __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/types.pxi":1601
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1604
 *         return _time_type_cache[unit_code]
 * 
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)             # <<<<<<<<<<<<<<
 * 
 *     out.init(ctime64(unit_code))
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Time64Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Time64Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1604, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Time64Type *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1606
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)
 * 
 *     out.init(ctime64(unit_code))             # <<<<<<<<<<<<<<
 *     _time_type_cache[unit_code] = out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::time64(__pyx_v_unit_code)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1606, __pyx_L1_error)

  /* "pyarrow/types.pxi":1607
 * 
 *     out.init(ctime64(unit_code))
 *     _time_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1607, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_2, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1609
 *     _time_type_cache[unit_code] = out
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1574
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.time64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1612
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_57date32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_56date32[] = "date32()\n\n    Create instance of 32-bit date (days since UNIX epoch 1970-01-01)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_57date32 = {"date32", (PyCFunction)__pyx_pw_7pyarrow_3lib_57date32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_56date32};
static PyObject *__pyx_pw_7pyarrow_3lib_57date32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_56date32(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_56date32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("date32", 0);

  /* "pyarrow/types.pxi":1616
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 *     """
 *     return primitive_type(_Type_DATE32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DATE32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1612
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */

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

/* "pyarrow/types.pxi":1619
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_59date64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_58date64[] = "date64()\n\n    Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_59date64 = {"date64", (PyCFunction)__pyx_pw_7pyarrow_3lib_59date64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_58date64};
static PyObject *__pyx_pw_7pyarrow_3lib_59date64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_58date64(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_58date64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("date64", 0);

  /* "pyarrow/types.pxi":1623
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 *     """
 *     return primitive_type(_Type_DATE64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DATE64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1619
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */

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

/* "pyarrow/types.pxi":1626
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_61float16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_60float16[] = "float16()\n\n    Create half-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_61float16 = {"float16", (PyCFunction)__pyx_pw_7pyarrow_3lib_61float16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_60float16};
static PyObject *__pyx_pw_7pyarrow_3lib_61float16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_60float16(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_60float16(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("float16", 0);

  /* "pyarrow/types.pxi":1630
 *     Create half-precision floating point type
 *     """
 *     return primitive_type(_Type_HALF_FLOAT)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::HALF_FLOAT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1626
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */

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

/* "pyarrow/types.pxi":1633
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_63float32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_62float32[] = "float32()\n\n    Create single-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_63float32 = {"float32", (PyCFunction)__pyx_pw_7pyarrow_3lib_63float32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_62float32};
static PyObject *__pyx_pw_7pyarrow_3lib_63float32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_62float32(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_62float32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("float32", 0);

  /* "pyarrow/types.pxi":1637
 *     Create single-precision floating point type
 *     """
 *     return primitive_type(_Type_FLOAT)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::FLOAT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1633
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */

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

/* "pyarrow/types.pxi":1640
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_65float64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_64float64[] = "float64()\n\n    Create double-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_65float64 = {"float64", (PyCFunction)__pyx_pw_7pyarrow_3lib_65float64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_64float64};
static PyObject *__pyx_pw_7pyarrow_3lib_65float64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_64float64(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_64float64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("float64", 0);

  /* "pyarrow/types.pxi":1644
 *     Create double-precision floating point type
 *     """
 *     return primitive_type(_Type_DOUBLE)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DOUBLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1640
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */

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

/* "pyarrow/types.pxi":1647
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */

static PyObject *__pyx_pw_7pyarrow_3lib_67decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_decimal128(int __pyx_v_precision, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_decimal128 *__pyx_optional_args) {
  int __pyx_v_scale = ((int)0);
  std::shared_ptr< arrow::DataType>  __pyx_v_decimal_type;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("decimal128", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_scale = __pyx_optional_args->scale;
    }
  }

  /* "pyarrow/types.pxi":1661
 *     """
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:             # <<<<<<<<<<<<<<
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 */
  __pyx_t_2 = ((__pyx_v_precision < 1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_precision > 38) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1662
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")             # <<<<<<<<<<<<<<
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1662, __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(4, 1662, __pyx_L1_error)

    /* "pyarrow/types.pxi":1661
 *     """
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:             # <<<<<<<<<<<<<<
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 */
  }

  /* "pyarrow/types.pxi":1663
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(decimal_type)
 * 
 */
  __pyx_v_decimal_type.reset(new  arrow::Decimal128Type(__pyx_v_precision, __pyx_v_scale));

  /* "pyarrow/types.pxi":1664
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_decimal_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1664, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1647
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.decimal128", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_67decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_66decimal128[] = "decimal128(int precision, int scale=0) -> DataType\n\n    Create decimal type with precision and scale and 128bit width\n\n    Parameters\n    ----------\n    precision : int\n    scale : int\n\n    Returns\n    -------\n    decimal_type : Decimal128Type\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_67decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_precision;
  int __pyx_v_scale;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decimal128 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,&__pyx_n_s_scale,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_precision)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scale);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decimal128") < 0)) __PYX_ERR(4, 1647, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_precision = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_precision == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1647, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_scale = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_scale == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1647, __pyx_L3_error)
    } else {
      __pyx_v_scale = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decimal128", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1647, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.decimal128", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_66decimal128(__pyx_self, __pyx_v_precision, __pyx_v_scale);

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

static PyObject *__pyx_pf_7pyarrow_3lib_66decimal128(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_precision, int __pyx_v_scale) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_decimal128 __pyx_t_2;
  __Pyx_RefNannySetupContext("decimal128", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.scale = __pyx_v_scale;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_decimal128(__pyx_v_precision, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/types.pxi":1667
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_69string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_68string[] = "string()\n\n    Create UTF8 variable-length string type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_69string = {"string", (PyCFunction)__pyx_pw_7pyarrow_3lib_69string, METH_NOARGS, __pyx_doc_7pyarrow_3lib_68string};
static PyObject *__pyx_pw_7pyarrow_3lib_69string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_68string(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_68string(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("string", 0);

  /* "pyarrow/types.pxi":1671
 *     Create UTF8 variable-length string type
 *     """
 *     return primitive_type(_Type_STRING)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::STRING)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1667
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */

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

/* "pyarrow/types.pxi":1674
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_71utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_70utf8[] = "utf8()\n\n    Alias for string()\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_71utf8 = {"utf8", (PyCFunction)__pyx_pw_7pyarrow_3lib_71utf8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_70utf8};
static PyObject *__pyx_pw_7pyarrow_3lib_71utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("utf8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_70utf8(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_70utf8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("utf8", 0);

  /* "pyarrow/types.pxi":1678
 *     Alias for string()
 *     """
 *     return string()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1678, __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/types.pxi":1674
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */

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

/* "pyarrow/types.pxi":1681
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_73binary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_72binary[] = "binary(int length=-1)\n\n    Create variable-length binary type\n\n    Parameters\n    ----------\n    length : int, optional, default -1\n        If length == -1 then return a variable length binary type. If length is\n        greater than or equal to 0 then return a fixed size binary type of\n        width `length`.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_73binary = {"binary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_73binary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_72binary};
static PyObject *__pyx_pw_7pyarrow_3lib_73binary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_length;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("binary (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "binary") < 0)) __PYX_ERR(4, 1681, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1681, __pyx_L3_error)
    } else {
      __pyx_v_length = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("binary", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1681, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_72binary(__pyx_self, __pyx_v_length);

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

static PyObject *__pyx_pf_7pyarrow_3lib_72binary(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_length) {
  std::shared_ptr< arrow::DataType>  __pyx_v_fixed_size_binary_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("binary", 0);

  /* "pyarrow/types.pxi":1692
 *         width `length`.
 *     """
 *     if length == -1:             # <<<<<<<<<<<<<<
 *         return primitive_type(_Type_BINARY)
 * 
 */
  __pyx_t_1 = ((__pyx_v_length == -1L) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1693
 *     """
 *     if length == -1:
 *         return primitive_type(_Type_BINARY)             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::BINARY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1692
 *         width `length`.
 *     """
 *     if length == -1:             # <<<<<<<<<<<<<<
 *         return primitive_type(_Type_BINARY)
 * 
 */
  }

  /* "pyarrow/types.pxi":1696
 * 
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 *     fixed_size_binary_type.reset(new CFixedSizeBinaryType(length))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(fixed_size_binary_type)
 * 
 */
  __pyx_v_fixed_size_binary_type.reset(new  arrow::FixedSizeBinaryType(__pyx_v_length));

  /* "pyarrow/types.pxi":1697
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 *     fixed_size_binary_type.reset(new CFixedSizeBinaryType(length))
 *     return pyarrow_wrap_data_type(fixed_size_binary_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_fixed_size_binary_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1681
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */

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

/* "pyarrow/types.pxi":1700
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_75large_binary(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_74large_binary[] = "large_binary()\n\n    Create large variable-length binary type\n\n    This data type may not be supported by all Arrow implementations.  Unless\n    you need to represent data larger than 2GB, you should prefer binary().\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_75large_binary = {"large_binary", (PyCFunction)__pyx_pw_7pyarrow_3lib_75large_binary, METH_NOARGS, __pyx_doc_7pyarrow_3lib_74large_binary};
static PyObject *__pyx_pw_7pyarrow_3lib_75large_binary(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_binary (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_74large_binary(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_74large_binary(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("large_binary", 0);

  /* "pyarrow/types.pxi":1707
 *     you need to represent data larger than 2GB, you should prefer binary().
 *     """
 *     return primitive_type(_Type_LARGE_BINARY)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::LARGE_BINARY)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1700
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */

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

/* "pyarrow/types.pxi":1710
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_77large_string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_76large_string[] = "large_string()\n\n    Create large UTF8 variable-length string type\n\n    This data type may not be supported by all Arrow implementations.  Unless\n    you need to represent data larger than 2GB, you should prefer string().\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_77large_string = {"large_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_77large_string, METH_NOARGS, __pyx_doc_7pyarrow_3lib_76large_string};
static PyObject *__pyx_pw_7pyarrow_3lib_77large_string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_76large_string(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_76large_string(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("large_string", 0);

  /* "pyarrow/types.pxi":1717
 *     you need to represent data larger than 2GB, you should prefer string().
 *     """
 *     return primitive_type(_Type_LARGE_STRING)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::LARGE_STRING)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1710
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */

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

/* "pyarrow/types.pxi":1720
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_79large_utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_78large_utf8[] = "large_utf8()\n\n    Alias for large_string()\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_79large_utf8 = {"large_utf8", (PyCFunction)__pyx_pw_7pyarrow_3lib_79large_utf8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_78large_utf8};
static PyObject *__pyx_pw_7pyarrow_3lib_79large_utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_utf8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_78large_utf8(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_78large_utf8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("large_utf8", 0);

  /* "pyarrow/types.pxi":1724
 *     Alias for large_string()
 *     """
 *     return large_string()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_large_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1724, __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/types.pxi":1720
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */

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

/* "pyarrow/types.pxi":1727
 * 
 * 
 * cpdef ListType list_(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */

static PyObject *__pyx_pw_7pyarrow_3lib_81list_(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_f_7pyarrow_3lib_list_(PyObject *__pyx_v_value_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v__field = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_list_type;
  struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_out = 0;
  struct __pyx_obj_7pyarrow_3lib_ListType *__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_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("list_", 0);

  /* "pyarrow/types.pxi":1743
 *         Field _field
 *         shared_ptr[CDataType] list_type
 *         ListType out = ListType.__new__(ListType)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(value_type, DataType):
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1743, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_ListType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1745
 *         ListType out = ListType.__new__(ListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1746
 * 
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)             # <<<<<<<<<<<<<<
 *     elif isinstance(value_type, Field):
 *         _field = value_type
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1746, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1746, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1746, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_item);
      __Pyx_GIVEREF(__pyx_n_u_item);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_u_item);
      __Pyx_INCREF(__pyx_v_value_type);
      __Pyx_GIVEREF(__pyx_v_value_type);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value_type);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1746, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1746, __pyx_L1_error)
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1745
 *         ListType out = ListType.__new__(ListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1747
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1748
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 *         _field = value_type             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('List requires DataType or Field')
 */
    if (!(likely(((__pyx_v_value_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1748, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_value_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1747
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1750
 *         _field = value_type
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     list_type.reset(new CListType(_field.sp_field))
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1750, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1752
 *         raise TypeError('List requires DataType or Field')
 * 
 *     list_type.reset(new CListType(_field.sp_field))             # <<<<<<<<<<<<<<
 *     out.init(list_type)
 *     return out
 */
  __pyx_v_list_type.reset(new  arrow::ListType(__pyx_v__field->sp_field));

  /* "pyarrow/types.pxi":1753
 * 
 *     list_type.reset(new CListType(_field.sp_field))
 *     out.init(list_type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ListType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out), __pyx_v_list_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1753, __pyx_L1_error)

  /* "pyarrow/types.pxi":1754
 *     list_type.reset(new CListType(_field.sp_field))
 *     out.init(list_type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1727
 * 
 * 
 * cpdef ListType list_(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */

  /* 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.lib.list_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__field);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_81list_(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_80list_[] = "list_(value_type) -> ListType\n\n    Create ListType instance from child data type or field\n\n    Parameters\n    ----------\n    value_type : DataType or Field\n\n    Returns\n    -------\n    list_type : DataType\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_81list_(PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_80list_(__pyx_self, ((PyObject *)__pyx_v_value_type));

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

static PyObject *__pyx_pf_7pyarrow_3lib_80list_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("list_", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_list_(__pyx_v_value_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/types.pxi":1757
 * 
 * 
 * cpdef LargeListType large_list(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create LargeListType instance from child data type or field
 */

static PyObject *__pyx_pw_7pyarrow_3lib_83large_list(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_f_7pyarrow_3lib_large_list(PyObject *__pyx_v_value_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v__field = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_list_type;
  struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_out = 0;
  struct __pyx_obj_7pyarrow_3lib_LargeListType *__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_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("large_list", 0);

  /* "pyarrow/types.pxi":1777
 *         Field _field
 *         shared_ptr[CDataType] list_type
 *         LargeListType out = LargeListType.__new__(LargeListType)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(value_type, DataType):
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LargeListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LargeListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1777, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_LargeListType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1779
 *         LargeListType out = LargeListType.__new__(LargeListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1780
 * 
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)             # <<<<<<<<<<<<<<
 *     elif isinstance(value_type, Field):
 *         _field = value_type
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1780, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1780, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_item);
      __Pyx_GIVEREF(__pyx_n_u_item);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_u_item);
      __Pyx_INCREF(__pyx_v_value_type);
      __Pyx_GIVEREF(__pyx_v_value_type);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value_type);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1780, __pyx_L1_error)
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1779
 *         LargeListType out = LargeListType.__new__(LargeListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1781
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1782
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 *         _field = value_type             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('List requires DataType or Field')
 */
    if (!(likely(((__pyx_v_value_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1782, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_value_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1781
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1784
 *         _field = value_type
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     list_type.reset(new CLargeListType(_field.sp_field))
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1784, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1786
 *         raise TypeError('List requires DataType or Field')
 * 
 *     list_type.reset(new CLargeListType(_field.sp_field))             # <<<<<<<<<<<<<<
 *     out.init(list_type)
 *     return out
 */
  __pyx_v_list_type.reset(new  arrow::LargeListType(__pyx_v__field->sp_field));

  /* "pyarrow/types.pxi":1787
 * 
 *     list_type.reset(new CLargeListType(_field.sp_field))
 *     out.init(list_type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out), __pyx_v_list_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1787, __pyx_L1_error)

  /* "pyarrow/types.pxi":1788
 *     list_type.reset(new CLargeListType(_field.sp_field))
 *     out.init(list_type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1757
 * 
 * 
 * cpdef LargeListType large_list(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create LargeListType instance from child data type or field
 */

  /* 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.lib.large_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__field);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_83large_list(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_82large_list[] = "large_list(value_type) -> LargeListType\n\n    Create LargeListType instance from child data type or field\n\n    This data type may not be supported by all Arrow implementations.\n    Unless you need to represent data larger than 2**31 elements, you should\n    prefer list_().\n\n    Parameters\n    ----------\n    value_type : DataType or Field\n\n    Returns\n    -------\n    list_type : DataType\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_83large_list(PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_list (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_82large_list(__pyx_self, ((PyObject *)__pyx_v_value_type));

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

static PyObject *__pyx_pf_7pyarrow_3lib_82large_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("large_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_large_list(__pyx_v_value_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/types.pxi":1791
 * 
 * 
 * cpdef DictionaryType dictionary(index_type, value_type, bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */

static PyObject *__pyx_pw_7pyarrow_3lib_85dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_f_7pyarrow_3lib_dictionary(PyObject *__pyx_v_index_type, PyObject *__pyx_v_value_type, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_dictionary *__pyx_optional_args) {
  int __pyx_v_ordered = ((int)0);
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__index_type = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__value_type = 0;
  struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_out = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_dict_type;
  struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("dictionary", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ordered = __pyx_optional_args->ordered;
    }
  }

  /* "pyarrow/types.pxi":1806
 *     """
 *     cdef:
 *         DataType _index_type = ensure_type(index_type, allow_none=False)             # <<<<<<<<<<<<<<
 *         DataType _value_type = ensure_type(value_type, allow_none=False)
 *         DictionaryType out = DictionaryType.__new__(DictionaryType)
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_index_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__index_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1807
 *     cdef:
 *         DataType _index_type = ensure_type(index_type, allow_none=False)
 *         DataType _value_type = ensure_type(value_type, allow_none=False)             # <<<<<<<<<<<<<<
 *         DictionaryType out = DictionaryType.__new__(DictionaryType)
 *         shared_ptr[CDataType] dict_type
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_value_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1808
 *         DataType _index_type = ensure_type(index_type, allow_none=False)
 *         DataType _value_type = ensure_type(value_type, allow_none=False)
 *         DictionaryType out = DictionaryType.__new__(DictionaryType)             # <<<<<<<<<<<<<<
 *         shared_ptr[CDataType] dict_type
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DictionaryType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DictionaryType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1808, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1811
 *         shared_ptr[CDataType] dict_type
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:             # <<<<<<<<<<<<<<
 *         raise TypeError("The dictionary index type should be signed integer.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v__index_type), __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Type_INT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Type_INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Type_INT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Type_INT64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/types.pxi":1812
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:
 *         raise TypeError("The dictionary index type should be signed integer.")             # <<<<<<<<<<<<<<
 * 
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1812, __pyx_L1_error)

    /* "pyarrow/types.pxi":1811
 *         shared_ptr[CDataType] dict_type
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:             # <<<<<<<<<<<<<<
 *         raise TypeError("The dictionary index type should be signed integer.")
 * 
 */
  }

  /* "pyarrow/types.pxi":1814
 *         raise TypeError("The dictionary index type should be signed integer.")
 * 
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,             # <<<<<<<<<<<<<<
 *                                         _value_type.sp_type, ordered == 1))
 *     out.init(dict_type)
 */
  __pyx_v_dict_type.reset(new  arrow::DictionaryType(__pyx_v__index_type->sp_type, __pyx_v__value_type->sp_type, (__pyx_v_ordered == 1)));

  /* "pyarrow/types.pxi":1816
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,
 *                                         _value_type.sp_type, ordered == 1))
 *     out.init(dict_type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out), __pyx_v_dict_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1816, __pyx_L1_error)

  /* "pyarrow/types.pxi":1817
 *                                         _value_type.sp_type, ordered == 1))
 *     out.init(dict_type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1791
 * 
 * 
 * cpdef DictionaryType dictionary(index_type, value_type, bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.dictionary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__index_type);
  __Pyx_XDECREF((PyObject *)__pyx_v__value_type);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_85dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_84dictionary[] = "dictionary(index_type, value_type, bool ordered=False) -> DictionaryType\n\n    Dictionary (categorical, or simply encoded) type\n\n    Parameters\n    ----------\n    index_type : DataType\n    value_type : DataType\n    ordered : boolean\n\n    Returns\n    -------\n    type : DictionaryType\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_85dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index_type = 0;
  PyObject *__pyx_v_value_type = 0;
  int __pyx_v_ordered;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index_type,&__pyx_n_s_value_type,&__pyx_n_s_ordered,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dictionary", 0, 2, 3, 1); __PYX_ERR(4, 1791, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ordered);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dictionary") < 0)) __PYX_ERR(4, 1791, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index_type = values[0];
    __pyx_v_value_type = values[1];
    if (values[2]) {
      __pyx_v_ordered = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ordered == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1791, __pyx_L3_error)
    } else {
      __pyx_v_ordered = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dictionary", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1791, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.dictionary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_84dictionary(__pyx_self, __pyx_v_index_type, __pyx_v_value_type, __pyx_v_ordered);

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

static PyObject *__pyx_pf_7pyarrow_3lib_84dictionary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index_type, PyObject *__pyx_v_value_type, int __pyx_v_ordered) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_dictionary __pyx_t_2;
  __Pyx_RefNannySetupContext("dictionary", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.ordered = __pyx_v_ordered;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_dictionary(__pyx_v_index_type, __pyx_v_value_type, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/types.pxi":1820
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_87struct(PyObject *__pyx_self, PyObject *__pyx_v_fields); /*proto*/
static char __pyx_doc_7pyarrow_3lib_86struct[] = "struct(fields)\n\n    Create StructType instance from fields\n\n    Parameters\n    ----------\n    fields : iterable of Fields or tuples, or mapping of strings to DataTypes\n\n    Examples\n    --------\n    ::\n\n        import pyarrow as pa\n        fields = [\n            ('f1', pa.int32()),\n            ('f2', pa.string()),\n        ]\n        struct_type = pa.struct(fields)\n\n        fields = [\n            pa.field('f1', pa.int32()),\n            pa.field('f2', pa.string(), nullable=false),\n        ]\n        struct_type = pa.struct(fields)\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_87struct = {"struct", (PyCFunction)__pyx_pw_7pyarrow_3lib_87struct, METH_O, __pyx_doc_7pyarrow_3lib_86struct};
static PyObject *__pyx_pw_7pyarrow_3lib_87struct(PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("struct (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_86struct(__pyx_self, ((PyObject *)__pyx_v_fields));

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

static PyObject *__pyx_pf_7pyarrow_3lib_86struct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_py_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  std::shared_ptr< arrow::DataType>  __pyx_v_struct_type;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("struct", 0);
  __Pyx_INCREF(__pyx_v_fields);

  /* "pyarrow/types.pxi":1854
 *         cdef shared_ptr[CDataType] struct_type
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compat); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1855
 * 
 *     if isinstance(fields, compat.Mapping):
 *         fields = fields.items()             # <<<<<<<<<<<<<<
 * 
 *     for item in fields:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1854
 *         cdef shared_ptr[CDataType] struct_type
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":1857
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1857, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 1857, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 1857, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1857, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1858
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
    __pyx_t_4 = PyTuple_Check(__pyx_v_item); 
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/types.pxi":1859
 *     for item in fields:
 *         if isinstance(item, tuple):
 *             py_field = field(*item)             # <<<<<<<<<<<<<<
 *         else:
 *             py_field = item
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1859, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "pyarrow/types.pxi":1858
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":1861
 *             py_field = field(*item)
 *         else:
 *             py_field = item             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
    /*else*/ {
      if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1861, __pyx_L1_error)
      __pyx_t_8 = __pyx_v_item;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;
    }
    __pyx_L6:;

    /* "pyarrow/types.pxi":1862
 *         else:
 *             py_field = item
 *         c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     struct_type.reset(new CStructType(c_fields))
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 1862, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1857
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1864
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     struct_type.reset(new CStructType(c_fields))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(struct_type)
 * 
 */
  __pyx_v_struct_type.reset(new  arrow::StructType(__pyx_v_c_fields));

  /* "pyarrow/types.pxi":1865
 * 
 *     struct_type.reset(new CStructType(c_fields))
 *     return pyarrow_wrap_data_type(struct_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_struct_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1820
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_field);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1868
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_89union(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_88union[] = "union(children_fields, mode)\n\n    Create UnionType from children fields.\n\n    Parameters\n    ----------\n    fields : sequence of Field values\n    mode : str\n        'dense' or 'sparse'\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_89union = {"union", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_89union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_88union};
static PyObject *__pyx_pw_7pyarrow_3lib_89union(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_children_fields = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("union (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_children_fields,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_fields)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("union", 1, 2, 2, 1); __PYX_ERR(4, 1868, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "union") < 0)) __PYX_ERR(4, 1868, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_children_fields = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("union", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1868, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_88union(__pyx_self, __pyx_v_children_fields, __pyx_v_mode);

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

static PyObject *__pyx_pf_7pyarrow_3lib_88union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_children_fields, PyObject *__pyx_v_mode) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_child_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  std::vector<uint8_t>  __pyx_v_type_codes;
  std::shared_ptr< arrow::DataType>  __pyx_v_union_type;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  __Pyx_RefNannySetupContext("union", 0);
  __Pyx_INCREF(__pyx_v_mode);

  /* "pyarrow/types.pxi":1889
 *         int i
 * 
 *     if isinstance(mode, int):             # <<<<<<<<<<<<<<
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_mode); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":1890
 * 
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):             # <<<<<<<<<<<<<<
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 */
    __Pyx_INCREF(__pyx_v_mode);
    __pyx_t_3 = __pyx_v_mode;
    __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1890, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L5_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":1891
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):
 *             raise ValueError("Invalid union mode {0!r}".format(mode))             # <<<<<<<<<<<<<<
 *     else:
 *         if mode == 'sparse':
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_mode);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(4, 1891, __pyx_L1_error)

      /* "pyarrow/types.pxi":1890
 * 
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):             # <<<<<<<<<<<<<<
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 */
    }

    /* "pyarrow/types.pxi":1889
 *         int i
 * 
 *     if isinstance(mode, int):             # <<<<<<<<<<<<<<
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1893
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 *         if mode == 'sparse':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 */
  /*else*/ {
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_sparse, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1893, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "pyarrow/types.pxi":1894
 *     else:
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE             # <<<<<<<<<<<<<<
 *         elif mode == 'dense':
 *             mode = _UnionMode_DENSE
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1893
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 *         if mode == 'sparse':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 */
      goto __pyx_L7;
    }

    /* "pyarrow/types.pxi":1895
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_dense, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1895, __pyx_L1_error)
    if (likely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":1896
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 *             mode = _UnionMode_DENSE             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1895
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
      goto __pyx_L7;
    }

    /* "pyarrow/types.pxi":1898
 *             mode = _UnionMode_DENSE
 *         else:
 *             raise ValueError("Invalid union mode {0!r}".format(mode))             # <<<<<<<<<<<<<<
 * 
 *     for i, child_field in enumerate(children_fields):
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mode);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(4, 1898, __pyx_L1_error)
    }
    __pyx_L7:;
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1900
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 * 
 *     for i, child_field in enumerate(children_fields):             # <<<<<<<<<<<<<<
 *         type_codes.push_back(i)
 *         c_fields.push_back(child_field.sp_field)
 */
  __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_v_children_fields)) || PyTuple_CheckExact(__pyx_v_children_fields)) {
    __pyx_t_3 = __pyx_v_children_fields; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_children_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1900, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 1900, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1900, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 1900, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1900, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1900, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1900, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_v_i = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "pyarrow/types.pxi":1901
 * 
 *     for i, child_field in enumerate(children_fields):
 *         type_codes.push_back(i)             # <<<<<<<<<<<<<<
 *         c_fields.push_back(child_field.sp_field)
 * 
 */
    try {
      __pyx_v_type_codes.push_back(__pyx_v_i);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 1901, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1902
 *     for i, child_field in enumerate(children_fields):
 *         type_codes.push_back(i)
 *         c_fields.push_back(child_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     if mode == UnionMode_SPARSE:
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_child_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 1902, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1900
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 * 
 *     for i, child_field in enumerate(children_fields):             # <<<<<<<<<<<<<<
 *         type_codes.push_back(i)
 *         c_fields.push_back(child_field.sp_field)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1904
 *         c_fields.push_back(child_field.sp_field)
 * 
 *     if mode == UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *         union_type.reset(new CUnionType(c_fields, type_codes,
 *                                         _UnionMode_SPARSE))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UnionMode_SPARSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_mode, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1904, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1904, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1905
 * 
 *     if mode == UnionMode_SPARSE:
 *         union_type.reset(new CUnionType(c_fields, type_codes,             # <<<<<<<<<<<<<<
 *                                         _UnionMode_SPARSE))
 *     else:
 */
    __pyx_v_union_type.reset(new  arrow::UnionType(__pyx_v_c_fields, __pyx_v_type_codes,  arrow::UnionMode::SPARSE));

    /* "pyarrow/types.pxi":1904
 *         c_fields.push_back(child_field.sp_field)
 * 
 *     if mode == UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *         union_type.reset(new CUnionType(c_fields, type_codes,
 *                                         _UnionMode_SPARSE))
 */
    goto __pyx_L10;
  }

  /* "pyarrow/types.pxi":1908
 *                                         _UnionMode_SPARSE))
 *     else:
 *         union_type.reset(new CUnionType(c_fields, type_codes,             # <<<<<<<<<<<<<<
 *                                         _UnionMode_DENSE))
 * 
 */
  /*else*/ {

    /* "pyarrow/types.pxi":1909
 *     else:
 *         union_type.reset(new CUnionType(c_fields, type_codes,
 *                                         _UnionMode_DENSE))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(union_type)
 */
    __pyx_v_union_type.reset(new  arrow::UnionType(__pyx_v_c_fields, __pyx_v_type_codes,  arrow::UnionMode::DENSE));
  }
  __pyx_L10:;

  /* "pyarrow/types.pxi":1911
 *                                         _UnionMode_DENSE))
 * 
 *     return pyarrow_wrap_data_type(union_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_union_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1868
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child_field);
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1966
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_91type_for_alias(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_90type_for_alias[] = "type_for_alias(name)\n\n    Return DataType given a string alias if one exists\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_91type_for_alias = {"type_for_alias", (PyCFunction)__pyx_pw_7pyarrow_3lib_91type_for_alias, METH_O, __pyx_doc_7pyarrow_3lib_90type_for_alias};
static PyObject *__pyx_pw_7pyarrow_3lib_91type_for_alias(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("type_for_alias (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_90type_for_alias(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7pyarrow_3lib_90type_for_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_alias = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("type_for_alias", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "pyarrow/types.pxi":1974
 *     type : DataType
 *     """
 *     name = name.lower()             # <<<<<<<<<<<<<<
 *     try:
 *         alias = _type_aliases[name]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1975
 *     """
 *     name = name.lower()
 *     try:             # <<<<<<<<<<<<<<
 *         alias = _type_aliases[name]
 *     except KeyError:
 */
  {
    __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/types.pxi":1976
 *     name = name.lower()
 *     try:
 *         alias = _type_aliases[name]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError('No type alias for {0}'.format(name))
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__type_aliases == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 1976, __pyx_L3_error)
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__type_aliases, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1976, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_alias = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/types.pxi":1975
 *     """
 *     name = name.lower()
 *     try:             # <<<<<<<<<<<<<<
 *         alias = _type_aliases[name]
 *     except KeyError:
 */
    }
    __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_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/types.pxi":1977
 *     try:
 *         alias = _type_aliases[name]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.type_for_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(4, 1977, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/types.pxi":1978
 *         alias = _type_aliases[name]
 *     except KeyError:
 *         raise ValueError('No type alias for {0}'.format(name))             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(alias, DataType):
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_No_type_alias_for_0, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1978, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1978, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1978, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(4, 1978, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":1975
 *     """
 *     name = name.lower()
 *     try:             # <<<<<<<<<<<<<<
 *         alias = _type_aliases[name]
 *     except KeyError:
 */
    __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_L8_try_end:;
  }

  /* "pyarrow/types.pxi":1980
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 *     if isinstance(alias, DataType):             # <<<<<<<<<<<<<<
 *         return alias
 *     return alias()
 */
  __pyx_t_11 = __Pyx_TypeCheck(__pyx_v_alias, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_12 = (__pyx_t_11 != 0);
  if (__pyx_t_12) {

    /* "pyarrow/types.pxi":1981
 * 
 *     if isinstance(alias, DataType):
 *         return alias             # <<<<<<<<<<<<<<
 *     return alias()
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_alias);
    __pyx_r = __pyx_v_alias;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1980
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 *     if isinstance(alias, DataType):             # <<<<<<<<<<<<<<
 *         return alias
 *     return alias()
 */
  }

  /* "pyarrow/types.pxi":1982
 *     if isinstance(alias, DataType):
 *         return alias
 *     return alias()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_alias);
  __pyx_t_2 = __pyx_v_alias; __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1982, __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/types.pxi":1966
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.type_for_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_alias);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1985
 * 
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):             # <<<<<<<<<<<<<<
 *     if allow_none and ty is None:
 *         return None
 */

static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_ensure_type(PyObject *__pyx_v_ty, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args) {
  bool __pyx_v_allow_none = ((bool)0);
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __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;
  __Pyx_RefNannySetupContext("ensure_type", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_allow_none = __pyx_optional_args->allow_none;
    }
  }

  /* "pyarrow/types.pxi":1986
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif isinstance(ty, DataType):
 */
  __pyx_t_2 = (__pyx_v_allow_none != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_ty == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1987
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:
 *         return None             # <<<<<<<<<<<<<<
 *     elif isinstance(ty, DataType):
 *         return ty
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1986
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif isinstance(ty, DataType):
 */
  }

  /* "pyarrow/types.pxi":1988
 *     if allow_none and ty is None:
 *         return None
 *     elif isinstance(ty, DataType):             # <<<<<<<<<<<<<<
 *         return ty
 *     elif isinstance(ty, six.string_types):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ty, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1989
 *         return None
 *     elif isinstance(ty, DataType):
 *         return ty             # <<<<<<<<<<<<<<
 *     elif isinstance(ty, six.string_types):
 *         return type_for_alias(ty)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (!(likely(((__pyx_v_ty) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ty, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1989, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_ty);
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_ty);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1988
 *     if allow_none and ty is None:
 *         return None
 *     elif isinstance(ty, DataType):             # <<<<<<<<<<<<<<
 *         return ty
 *     elif isinstance(ty, six.string_types):
 */
  }

  /* "pyarrow/types.pxi":1990
 *     elif isinstance(ty, DataType):
 *         return ty
 *     elif isinstance(ty, six.string_types):             # <<<<<<<<<<<<<<
 *         return type_for_alias(ty)
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_ty, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1991
 *         return ty
 *     elif isinstance(ty, six.string_types):
 *         return type_for_alias(ty)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('DataType expected, got {!r}'.format(type(ty)))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_ty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ty);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1991, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1990
 *     elif isinstance(ty, DataType):
 *         return ty
 *     elif isinstance(ty, six.string_types):             # <<<<<<<<<<<<<<
 *         return type_for_alias(ty)
 *     else:
 */
  }

  /* "pyarrow/types.pxi":1993
 *         return type_for_alias(ty)
 *     else:
 *         raise TypeError('DataType expected, got {!r}'.format(type(ty)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_DataType_expected_got_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_ty))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_ty)));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(4, 1993, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":1985
 * 
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):             # <<<<<<<<<<<<<<
 *     if allow_none and ty is None:
 *         return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ensure_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1996
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_93schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_92schema[] = "schema(fields, metadata=None)\n\n    Construct pyarrow.Schema from collection of fields\n\n    Parameters\n    ----------\n    field : iterable of Fields or tuples, or mapping of strings to DataTypes\n    metadata : dict, default None\n        Keys and values must be coercible to bytes\n\n    Examples\n    --------\n    ::\n\n        import pyarrow as pa\n        fields = [\n            ('some_int', pa.int32()),\n            ('some_string', pa.string()),\n        ]\n        schema = pa.schema(fields)\n\n    Returns\n    -------\n    schema : pyarrow.Schema\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_93schema = {"schema", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_93schema, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_92schema};
static PyObject *__pyx_pw_7pyarrow_3lib_93schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("schema (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_metadata,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "schema") < 0)) __PYX_ERR(4, 1996, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fields = values[0];
    __pyx_v_metadata = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("schema", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1996, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_92schema(__pyx_self, __pyx_v_fields, __pyx_v_metadata);

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

static PyObject *__pyx_pf_7pyarrow_3lib_92schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_py_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("schema", 0);
  __Pyx_INCREF(__pyx_v_fields);

  /* "pyarrow/types.pxi":2028
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compat); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 2028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":2029
 * 
 *     if isinstance(fields, compat.Mapping):
 *         fields = fields.items()             # <<<<<<<<<<<<<<
 * 
 *     for item in fields:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":2028
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":2031
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2031, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2031, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2031, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2031, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2031, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 2031, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":2032
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
    __pyx_t_4 = PyTuple_Check(__pyx_v_item); 
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/types.pxi":2033
 *     for item in fields:
 *         if isinstance(item, tuple):
 *             py_field = field(*item)             # <<<<<<<<<<<<<<
 *         else:
 *             py_field = item
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2033, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2033, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2033, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 2033, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "pyarrow/types.pxi":2032
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":2035
 *             py_field = field(*item)
 *         else:
 *             py_field = item             # <<<<<<<<<<<<<<
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")
 */
    /*else*/ {
      if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 2035, __pyx_L1_error)
      __pyx_t_8 = __pyx_v_item;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;
    }
    __pyx_L6:;

    /* "pyarrow/types.pxi":2036
 *         else:
 *             py_field = item
 *         if py_field is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)
 */
    __pyx_t_3 = (((PyObject *)__pyx_v_py_field) == Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":2037
 *             py_field = item
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2037, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(4, 2037, __pyx_L1_error)

      /* "pyarrow/types.pxi":2036
 *         else:
 *             py_field = item
 *         if py_field is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)
 */
    }

    /* "pyarrow/types.pxi":2038
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     if metadata is not None:
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 2038, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":2031
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2040
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_4 = (__pyx_v_metadata != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":2041
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":2042
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2042, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 2042, __pyx_L1_error)

      /* "pyarrow/types.pxi":2041
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/types.pxi":2043
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/types.pxi":2040
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/types.pxi":2045
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *     result = Schema.__new__(Schema)
 *     result.init_schema(c_schema)
 */
  __pyx_v_c_schema.reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

  /* "pyarrow/types.pxi":2046
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 *     result = Schema.__new__(Schema)             # <<<<<<<<<<<<<<
 *     result.init_schema(c_schema)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Schema(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Schema), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2046, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2047
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 *     result = Schema.__new__(Schema)
 *     result.init_schema(c_schema)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Schema *)__pyx_v_result->__pyx_vtab)->init_schema(__pyx_v_result, __pyx_v_c_schema);

  /* "pyarrow/types.pxi":2049
 *     result.init_schema(c_schema)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1996
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_field);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2052
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_95from_numpy_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype); /*proto*/
static char __pyx_doc_7pyarrow_3lib_94from_numpy_dtype[] = "from_numpy_dtype(dtype)\n\n    Convert NumPy dtype to pyarrow.DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_95from_numpy_dtype = {"from_numpy_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_95from_numpy_dtype, METH_O, __pyx_doc_7pyarrow_3lib_94from_numpy_dtype};
static PyObject *__pyx_pw_7pyarrow_3lib_95from_numpy_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_94from_numpy_dtype(__pyx_self, ((PyObject *)__pyx_v_dtype));

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

static PyObject *__pyx_pf_7pyarrow_3lib_94from_numpy_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dtype) {
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  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;
  __Pyx_RefNannySetupContext("from_numpy_dtype", 0);
  __Pyx_INCREF(__pyx_v_dtype);

  /* "pyarrow/types.pxi":2057
 *     """
 *     cdef shared_ptr[CDataType] c_type
 *     dtype = np.dtype(dtype)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":2058
 *     cdef shared_ptr[CDataType] c_type
 *     dtype = np.dtype(dtype)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":2059
 *     dtype = np.dtype(dtype)
 *     with nogil:
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(c_type)
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NumPyDtypeToArrow(__pyx_v_dtype, (&__pyx_v_c_type))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 2059, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":2058
 *     cdef shared_ptr[CDataType] c_type
 *     dtype = np.dtype(dtype)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":2061
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     return pyarrow_wrap_data_type(c_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_c_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2052
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */

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

/* "pyarrow/types.pxi":2064
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_97is_boolean_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_96is_boolean_value[] = "is_boolean_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_97is_boolean_value = {"is_boolean_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_97is_boolean_value, METH_O, __pyx_doc_7pyarrow_3lib_96is_boolean_value};
static PyObject *__pyx_pw_7pyarrow_3lib_97is_boolean_value(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_boolean_value (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_96is_boolean_value(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_96is_boolean_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_boolean_value", 0);

  /* "pyarrow/types.pxi":2065
 * 
 * def is_boolean_value(object obj):
 *     return IsPyBool(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyBool(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2064
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */

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

/* "pyarrow/types.pxi":2068
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_99is_integer_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_98is_integer_value[] = "is_integer_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_99is_integer_value = {"is_integer_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_99is_integer_value, METH_O, __pyx_doc_7pyarrow_3lib_98is_integer_value};
static PyObject *__pyx_pw_7pyarrow_3lib_99is_integer_value(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_integer_value (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_98is_integer_value(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_98is_integer_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_integer_value", 0);

  /* "pyarrow/types.pxi":2069
 * 
 * def is_integer_value(object obj):
 *     return IsPyInt(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyInt(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2068
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */

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

/* "pyarrow/types.pxi":2072
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_101is_float_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_100is_float_value[] = "is_float_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_101is_float_value = {"is_float_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_101is_float_value, METH_O, __pyx_doc_7pyarrow_3lib_100is_float_value};
static PyObject *__pyx_pw_7pyarrow_3lib_101is_float_value(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_float_value (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_100is_float_value(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_100is_float_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_float_value", 0);

  /* "pyarrow/types.pxi":2073
 * 
 * def is_float_value(object obj):
 *     return IsPyFloat(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyFloat(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2072
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */

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

/* "pyarrow/types.pxi":2081
 *         shared_ptr[CExtensionTypeRegistry] registry
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 */

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

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

static int __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":2082
 * 
 *     def __cinit__(self):
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()             # <<<<<<<<<<<<<<
 * 
 *     def release_registry(self):
 */
  __pyx_v_self->registry =  arrow::ExtensionTypeRegistry::GetGlobalRegistry();

  /* "pyarrow/types.pxi":2081
 *         shared_ptr[CExtensionTypeRegistry] registry
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 */

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

/* "pyarrow/types.pxi":2084
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 *     def release_registry(self):             # <<<<<<<<<<<<<<
 *         self.registry.reset()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_3release_registry(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry[] = "_ExtensionRegistryNanny.release_registry(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_3release_registry(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("release_registry (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry(((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("release_registry", 0);

  /* "pyarrow/types.pxi":2085
 * 
 *     def release_registry(self):
 *         self.registry.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->registry.reset();

  /* "pyarrow/types.pxi":2084
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 *     def release_registry(self):             # <<<<<<<<<<<<<<
 *         self.registry.reset()
 * 
 */

  /* 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):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__[] = "_ExtensionRegistryNanny.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._ExtensionRegistryNanny.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__[] = "_ExtensionRegistryNanny.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

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

/* "pyarrow/types.pxi":2091
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_103_register_py_extension_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_102_register_py_extension_type[] = "_register_py_extension_type()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_103_register_py_extension_type = {"_register_py_extension_type", (PyCFunction)__pyx_pw_7pyarrow_3lib_103_register_py_extension_type, METH_NOARGS, __pyx_doc_7pyarrow_3lib_102_register_py_extension_type};
static PyObject *__pyx_pw_7pyarrow_3lib_103_register_py_extension_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_register_py_extension_type (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_102_register_py_extension_type(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_102_register_py_extension_type(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  std::shared_ptr< arrow::ExtensionType>  __pyx_v_cpy_ext_type;
  std::string __pyx_v_c_extension_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_register_py_extension_type", 0);

  /* "pyarrow/types.pxi":2095
 *         DataType storage_type
 *         shared_ptr[CExtensionType] cpy_ext_type
 *         c_string c_extension_name = tobytes("arrow.py_extension_type")             # <<<<<<<<<<<<<<
 * 
 *     # Make a dummy C++ ExtensionType
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_arrow_py_extension_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_arrow_py_extension_type);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2095, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_extension_name = __pyx_t_4;

  /* "pyarrow/types.pxi":2098
 * 
 *     # Make a dummy C++ ExtensionType
 *     storage_type = null()             # <<<<<<<<<<<<<<
 *     check_status(CPyExtensionType.FromClass(
 *         storage_type.sp_type, c_extension_name, PyExtensionType,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_null); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 2098, __pyx_L1_error)
  __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":2099
 *     # Make a dummy C++ ExtensionType
 *     storage_type = null()
 *     check_status(CPyExtensionType.FromClass(             # <<<<<<<<<<<<<<
 *         storage_type.sp_type, c_extension_name, PyExtensionType,
 *         &cpy_ext_type))
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status( arrow::py::PyExtensionType::FromClass(__pyx_v_storage_type->sp_type, __pyx_v_c_extension_name, ((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType), (&__pyx_v_cpy_ext_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 2099, __pyx_L1_error)

  /* "pyarrow/types.pxi":2102
 *         storage_type.sp_type, c_extension_name, PyExtensionType,
 *         &cpy_ext_type))
 *     check_status(             # <<<<<<<<<<<<<<
 *         RegisterPyExtensionType(<shared_ptr[CDataType]> cpy_ext_type))
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::RegisterPyExtensionType(((std::shared_ptr< arrow::DataType> )__pyx_v_cpy_ext_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 2102, __pyx_L1_error)

  /* "pyarrow/types.pxi":2091
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */

  /* 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.lib._register_py_extension_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_storage_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2106
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_105_unregister_py_extension_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_104_unregister_py_extension_types[] = "_unregister_py_extension_types()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_105_unregister_py_extension_types = {"_unregister_py_extension_types", (PyCFunction)__pyx_pw_7pyarrow_3lib_105_unregister_py_extension_types, METH_NOARGS, __pyx_doc_7pyarrow_3lib_104_unregister_py_extension_types};
static PyObject *__pyx_pw_7pyarrow_3lib_105_unregister_py_extension_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_unregister_py_extension_types (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_104_unregister_py_extension_types(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_104_unregister_py_extension_types(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_ext_type = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("_unregister_py_extension_types", 0);

  /* "pyarrow/types.pxi":2111
 *     # teardown stage, it will invoke CPython APIs such as Py_DECREF
 *     # with a destroyed interpreter.
 *     unregister_extension_type("arrow.py_extension_type")             # <<<<<<<<<<<<<<
 *     for ext_type in _python_extension_types_registry:
 *         try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unregister_extension_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_arrow_py_extension_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_arrow_py_extension_type);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":2112
 *     # with a destroyed interpreter.
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:             # <<<<<<<<<<<<<<
 *         try:
 *             unregister_extension_type(ext_type.extension_name)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_python_extension_types_registry); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2112, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 2112, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2112, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 2112, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2112, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 2112, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_ext_type, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":2113
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:
 *         try:             # <<<<<<<<<<<<<<
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:
 */
    {
      __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/types.pxi":2114
 *     for ext_type in _python_extension_types_registry:
 *         try:
 *             unregister_extension_type(ext_type.extension_name)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unregister_extension_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2114, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext_type, __pyx_n_s_extension_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2114, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2114, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyarrow/types.pxi":2113
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:
 *         try:             # <<<<<<<<<<<<<<
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:
 */
      }
      __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_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "pyarrow/types.pxi":2115
 *         try:
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 *     _registry_nanny.release_registry()
 */
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_11) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "pyarrow/types.pxi":2113
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:
 *         try:             # <<<<<<<<<<<<<<
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:
 */
      __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_exception_handled:;
      __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);
      __pyx_L12_try_end:;
    }

    /* "pyarrow/types.pxi":2112
 *     # with a destroyed interpreter.
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:             # <<<<<<<<<<<<<<
 *         try:
 *             unregister_extension_type(ext_type.extension_name)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2117
 *         except KeyError:
 *             pass
 *     _registry_nanny.release_registry()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_registry_nanny); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_release_registry); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2106
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib._unregister_py_extension_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ext_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":154
 * cdef class Scalar:
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __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_3lib_6Scalar_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Scalar___reduce_cython__[] = "Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__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;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.type,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->type));
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 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:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.type is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.type is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 */
  /*else*/ {
    __pyx_t_3 = (((PyObject *)__pyx_v_self->type) != Py_None);
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.type is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_93969614);
    __Pyx_GIVEREF(__pyx_int_93969614);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93969614);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __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.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Scalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_93969614);
    __Pyx_GIVEREF(__pyx_int_93969614);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93969614);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __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.lib.Scalar.__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_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Scalar_2__setstate_cython__[] = "Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */

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

/* "pyarrow/scalar.pxi":33
 *     """
 *     # TODO rename this NullValue?
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         global NA
 *         if NA is not None:
 */

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

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

static int __pyx_pf_7pyarrow_3lib_8NullType___cinit__(struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  int __pyx_r;
  __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;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/scalar.pxi":35
 *     def __cinit__(self):
 *         global NA
 *         if NA is not None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/scalar.pxi":36
 *         global NA
 *         if NA is not None:
 *             raise Exception('Cannot create multiple NAType instances')             # <<<<<<<<<<<<<<
 * 
 *         self.type = null()
 */
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __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(5, 36, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":35
 *     def __cinit__(self):
 *         global NA
 *         if NA is not None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 */
  }

  /* "pyarrow/scalar.pxi":38
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 *         self.type = null()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_null); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.type));
  __pyx_v_self->__pyx_base.type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":33
 *     """
 *     # TODO rename this NullValue?
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         global NA
 *         if NA is not None:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":40
 *         self.type = null()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NULL'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_2__repr__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_2__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/scalar.pxi":41
 * 
 *     def __repr__(self):
 *         return 'NULL'             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_u_NULL);
  __pyx_r = __pyx_n_u_NULL;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":40
 *         self.type = null()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NULL'
 * 
 */

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

/* "pyarrow/scalar.pxi":43
 *         return 'NULL'
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return None
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_5as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_4as_py[] = "NullType.as_py(self)\n\n        Return None\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_5as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_4as_py(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_4as_py(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":47
 *         Return None
 *         """
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":43
 *         return 'NULL'
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return None
 */

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

/* "pyarrow/scalar.pxi":49
 *         return None
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return NA
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_6__eq__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_6__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/scalar.pxi":50
 * 
 *     def __eq__(self, other):
 *         return NA             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":49
 *         return None
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return NA
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__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("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_8__reduce_cython__[] = "NullType.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_10__setstate_cython__[] = "NullType.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

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

/* "pyarrow/scalar.pxi":61
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use array "
 *                         "subscription instead."
 */

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

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

static int __pyx_pf_7pyarrow_3lib_10ArrayValue___init__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/scalar.pxi":64
 *         raise TypeError("Do not call {}'s constructor directly, use array "
 *                         "subscription instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_5, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":62
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use array "             # <<<<<<<<<<<<<<
 *                         "subscription instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(5, 62, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":61
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use array "
 *                         "subscription instead."
 */

  /* 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.lib.ArrayValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":66
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                    int64_t index):
 *         self.type = type
 */

static void __pyx_f_7pyarrow_3lib_10ArrayValue_init(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array, int64_t __pyx_v_index) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/scalar.pxi":68
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,
 *                    int64_t index):
 *         self.type = type             # <<<<<<<<<<<<<<
 *         self.index = index
 *         self._set_array(sp_array)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_type));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.type));
  __pyx_v_self->__pyx_base.type = __pyx_v_type;

  /* "pyarrow/scalar.pxi":69
 *                    int64_t index):
 *         self.type = type
 *         self.index = index             # <<<<<<<<<<<<<<
 *         self._set_array(sp_array)
 * 
 */
  __pyx_v_self->index = __pyx_v_index;

  /* "pyarrow/scalar.pxi":70
 *         self.type = type
 *         self.index = index
 *         self._set_array(sp_array)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *)__pyx_v_self->__pyx_vtab)->_set_array(__pyx_v_self, __pyx_v_sp_array);

  /* "pyarrow/scalar.pxi":66
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                    int64_t index):
 *         self.type = type
 */

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

/* "pyarrow/scalar.pxi":72
 *         self._set_array(sp_array)
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 * 
 */

static void __pyx_f_7pyarrow_3lib_10ArrayValue__set_array(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":73
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_v_self->sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":72
 *         self._set_array(sp_array)
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 * 
 */

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

/* "pyarrow/scalar.pxi":75
 *         self.sp_array = sp_array
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_2__repr__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

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

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

  /* "pyarrow/scalar.pxi":76
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 76, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":77
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__repr__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":76
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":79
 *             return repr(self.as_py())
 *         else:
 *             return super(Scalar, self).__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":75
 *         self.sp_array = sp_array
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

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

/* "pyarrow/scalar.pxi":81
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_4__str__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/scalar.pxi":82
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 82, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":83
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__str__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":82
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":85
 *             return str(self.as_py())
 *         else:
 *             return super(Scalar, self).__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":81
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":87
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_6__eq__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __Pyx_INCREF(__pyx_v_other);

  /* "pyarrow/scalar.pxi":88
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 88, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/scalar.pxi":89
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_ArrayValue); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/scalar.pxi":90
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()             # <<<<<<<<<<<<<<
 *             return self.as_py() == other
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":89
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    }

    /* "pyarrow/scalar.pxi":91
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 *             return self.as_py() == other             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 91, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":88
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 */
  }

  /* "pyarrow/scalar.pxi":93
 *             return self.as_py() == other
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 93, __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(5, 93, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":87
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":96
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_10ArrayValue_9__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_10ArrayValue_9__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_8__hash__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

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

static Py_hash_t __pyx_pf_7pyarrow_3lib_10ArrayValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/scalar.pxi":97
 * 
 *     def __hash__(self):
 *         return hash(self.as_py())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":96
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10ArrayValue_10__reduce_cython__[] = "ArrayValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10ArrayValue_12__setstate_cython__[] = "ArrayValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":105
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_as_py[] = "BooleanValue.as_py(self)\n\n        Return this value as a Python bool.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self) {
   arrow::BooleanArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":109
 *         Return this value as a Python bool.
 *         """
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::BooleanArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":110
 *         """
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":105
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bool.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BooleanValue.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_2__reduce_cython__[] = "BooleanValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_4__setstate_cython__[] = "BooleanValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":118
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_as_py[] = "Int8Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self) {
   arrow::Int8Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":122
 *         Return this value as a Python int.
 *         """
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int8Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":123
 *         """
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":118
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_2__reduce_cython__[] = "Int8Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_4__setstate_cython__[] = "Int8Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":131
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_as_py[] = "UInt8Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self) {
   arrow::UInt8Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":135
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt8Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":136
 *         """
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":131
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_2__reduce_cython__[] = "UInt8Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_4__setstate_cython__[] = "UInt8Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":144
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_as_py[] = "Int16Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self) {
   arrow::Int16Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":148
 *         Return this value as a Python int.
 *         """
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int16Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":149
 *         """
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":144
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_2__reduce_cython__[] = "Int16Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_4__setstate_cython__[] = "Int16Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":157
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_as_py[] = "UInt16Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self) {
   arrow::UInt16Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":161
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt16Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":162
 *         """
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":157
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_2__reduce_cython__[] = "UInt16Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_4__setstate_cython__[] = "UInt16Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":170
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_as_py[] = "Int32Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self) {
   arrow::Int32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":174
 *         Return this value as a Python int.
 *         """
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":175
 *         """
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":170
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_2__reduce_cython__[] = "Int32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_4__setstate_cython__[] = "Int32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":183
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_as_py[] = "UInt32Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self) {
   arrow::UInt32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":187
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":188
 *         """
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":183
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_2__reduce_cython__[] = "UInt32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_4__setstate_cython__[] = "UInt32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":196
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_as_py[] = "Int64Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self) {
   arrow::Int64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":200
 *         Return this value as a Python int.
 *         """
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":201
 *         """
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":196
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_2__reduce_cython__[] = "Int64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_4__setstate_cython__[] = "Int64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":209
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_as_py[] = "UInt64Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self) {
   arrow::UInt64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":213
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":214
 *         """
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":209
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_2__reduce_cython__[] = "UInt64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_4__setstate_cython__[] = "UInt64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":222
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date32Value_as_py[] = "Date32Value.as_py(self)\n\n        Return this value as a Python datetime.datetime instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Date32Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self) {
   arrow::Date32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":226
 *         Return this value as a Python datetime.datetime instance.
 *         """
 *         cdef CDate32Array* ap = <CDate32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *         # Shift to seconds since epoch
 */
  __pyx_v_ap = (( arrow::Date32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":229
 * 
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(days=ap.Value(self.index)))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":230
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(days=ap.Value(self.index)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_days, __pyx_t_4) < 0) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":229
 * 
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(days=ap.Value(self.index)))
 * 
 */
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 229, __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/scalar.pxi":222
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

  /* 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.lib.Date32Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date32Value_2__reduce_cython__[] = "Date32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Date32Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date32Value_4__setstate_cython__[] = "Date32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Date32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":238
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date64Value_as_py[] = "Date64Value.as_py(self)\n\n        Return this value as a Python datetime.datetime instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Date64Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self) {
   arrow::Date64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":242
 *         Return this value as a Python datetime.datetime instance.
 *         """
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(
 */
  __pyx_v_ap = (( arrow::Date64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":243
 *         """
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(
 *                     days=ap.Value(self.index) / 86400000))
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":244
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(             # <<<<<<<<<<<<<<
 *                     days=ap.Value(self.index) / 86400000))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":245
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(
 *                     days=ap.Value(self.index) / 86400000))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)) / 86400000.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_days, __pyx_t_4) < 0) __PYX_ERR(5, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":244
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(             # <<<<<<<<<<<<<<
 *                     days=ap.Value(self.index) / 86400000))
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":243
 *         """
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(
 *                     days=ap.Value(self.index) / 86400000))
 */
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 243, __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/scalar.pxi":238
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

  /* 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.lib.Date64Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date64Value_2__reduce_cython__[] = "Date64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Date64Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date64Value_4__setstate_cython__[] = "Date64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Date64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":253
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_as_py[] = "Time32Value.as_py(self)\n\n        Return this value as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self) {
   arrow::Time32Array *__pyx_v_ap;
   arrow::Time32Type *__pyx_v_dtype;
  PyObject *__pyx_v_delta = 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;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":258
 *         """
 *         cdef:
 *             CTime32Array* ap = <CTime32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::Time32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":259
 *         cdef:
 *             CTime32Array* ap = <CTime32Array*> self.sp_array.get()
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()             # <<<<<<<<<<<<<<
 * 
 *         if dtype.unit() == TimeUnit_SECOND:
 */
  __pyx_v_dtype = (( arrow::Time32Type *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":261
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()
 * 
 *         if dtype.unit() == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 */
  __pyx_t_1 = ((__pyx_v_dtype->unit() ==  arrow::TimeUnit::SECOND) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":262
 * 
 *         if dtype.unit() == TimeUnit_SECOND:
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))             # <<<<<<<<<<<<<<
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seconds, __pyx_t_4) < 0) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_delta = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":263
 *         if dtype.unit() == TimeUnit_SECOND:
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 *         else:
 *             return _box_time_milli(ap.Value(self.index))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_delta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":261
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()
 * 
 *         if dtype.unit() == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 */
  }

  /* "pyarrow/scalar.pxi":265
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 *         else:
 *             return _box_time_milli(ap.Value(self.index))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib__box_time_milli(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":253
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Time32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delta);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_2__reduce_cython__[] = "Time32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_4__setstate_cython__[] = "Time32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":273
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_as_py[] = "Time64Value.as_py(self)\n\n        Return this value as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self) {
   arrow::Time64Array *__pyx_v_ap;
   arrow::Time64Type *__pyx_v_dtype;
  int64_t __pyx_v_val;
  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;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":278
 *         """
 *         cdef:
 *             CTime64Array* ap = <CTime64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             CTime64Type* dtype = <CTime64Type*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::Time64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":279
 *         cdef:
 *             CTime64Array* ap = <CTime64Array*> self.sp_array.get()
 *             CTime64Type* dtype = <CTime64Type*> ap.type().get()             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t val = ap.Value(self.index)
 */
  __pyx_v_dtype = (( arrow::Time64Type *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":281
 *             CTime64Type* dtype = <CTime64Type*> ap.type().get()
 * 
 *         cdef int64_t val = ap.Value(self.index)             # <<<<<<<<<<<<<<
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return _box_time_micro(val)
 */
  __pyx_v_val = __pyx_v_ap->Value(__pyx_v_self->__pyx_base.index);

  /* "pyarrow/scalar.pxi":282
 * 
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *             return _box_time_micro(val)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_dtype->unit() ==  arrow::TimeUnit::MICRO) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":283
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return _box_time_micro(val)             # <<<<<<<<<<<<<<
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib__box_time_micro(__pyx_v_val, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":282
 * 
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *             return _box_time_micro(val)
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":285
 *             return _box_time_micro(val)
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "pyarrow/scalar.pxi":286
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "pyarrow/scalar.pxi":285
 *             return _box_time_micro(val)
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":286
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyFloat_FromDouble((((double)__pyx_v_val) / 1000.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":285
 *             return _box_time_micro(val)
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
    __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/scalar.pxi":286
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":273
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Time64Value.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_2__reduce_cython__[] = "Time64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_4__setstate_cython__[] = "Time64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":289
 * 
 * 
 * cpdef _box_time_milli(int64_t val):             # <<<<<<<<<<<<<<
 *     delta = datetime.timedelta(milliseconds=val)
 *     return (datetime.datetime(1970, 1, 1) + delta).time()
 */

static PyObject *__pyx_pw_7pyarrow_3lib_107_box_time_milli(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_milli(int64_t __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_delta = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_box_time_milli", 0);

  /* "pyarrow/scalar.pxi":290
 * 
 * cpdef _box_time_milli(int64_t val):
 *     delta = datetime.timedelta(milliseconds=val)             # <<<<<<<<<<<<<<
 *     return (datetime.datetime(1970, 1, 1) + delta).time()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_milliseconds, __pyx_t_3) < 0) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_delta = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":291
 * cpdef _box_time_milli(int64_t val):
 *     delta = datetime.timedelta(milliseconds=val)
 *     return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_delta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 291, __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/scalar.pxi":289
 * 
 * 
 * cpdef _box_time_milli(int64_t val):             # <<<<<<<<<<<<<<
 *     delta = datetime.timedelta(milliseconds=val)
 *     return (datetime.datetime(1970, 1, 1) + delta).time()
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_107_box_time_milli(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static char __pyx_doc_7pyarrow_3lib_106_box_time_milli[] = "_box_time_milli(int64_t val)";
static PyObject *__pyx_pw_7pyarrow_3lib_107_box_time_milli(PyObject *__pyx_self, PyObject *__pyx_arg_val) {
  int64_t __pyx_v_val;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_box_time_milli (wrapper)", 0);
  assert(__pyx_arg_val); {
    __pyx_v_val = __Pyx_PyInt_As_int64_t(__pyx_arg_val); if (unlikely((__pyx_v_val == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 289, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._box_time_milli", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_106_box_time_milli(__pyx_self, ((int64_t)__pyx_v_val));

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

static PyObject *__pyx_pf_7pyarrow_3lib_106_box_time_milli(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_box_time_milli", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__box_time_milli(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/scalar.pxi":294
 * 
 * 
 * cpdef _box_time_micro(int64_t val):             # <<<<<<<<<<<<<<
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()
 */

static PyObject *__pyx_pw_7pyarrow_3lib_109_box_time_micro(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_micro(int64_t __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_box_time_micro", 0);

  /* "pyarrow/scalar.pxi":295
 * 
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *             datetime.timedelta(microseconds=val)).time()
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/scalar.pxi":296
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/scalar.pxi":295
 * 
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *             datetime.timedelta(microseconds=val)).time()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":296
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_microseconds, __pyx_t_5) < 0) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":295
 * 
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *             datetime.timedelta(microseconds=val)).time()
 * 
 */
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/scalar.pxi":296
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":294
 * 
 * 
 * cpdef _box_time_micro(int64_t val):             # <<<<<<<<<<<<<<
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_109_box_time_micro(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static char __pyx_doc_7pyarrow_3lib_108_box_time_micro[] = "_box_time_micro(int64_t val)";
static PyObject *__pyx_pw_7pyarrow_3lib_109_box_time_micro(PyObject *__pyx_self, PyObject *__pyx_arg_val) {
  int64_t __pyx_v_val;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_box_time_micro (wrapper)", 0);
  assert(__pyx_arg_val); {
    __pyx_v_val = __Pyx_PyInt_As_int64_t(__pyx_arg_val); if (unlikely((__pyx_v_val == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 294, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._box_time_micro", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_108_box_time_micro(__pyx_self, ((int64_t)__pyx_v_val));

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

static PyObject *__pyx_pf_7pyarrow_3lib_108_box_time_micro(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_box_time_micro", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__box_time_micro(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/scalar.pxi":303
 * 
 * 
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):             # <<<<<<<<<<<<<<
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 */

static PyObject *__pyx_f_7pyarrow_3lib__add_micros_maybe_localize(PyObject *__pyx_v_dt, PyObject *__pyx_v_micros, PyObject *__pyx_v_tzinfo) {
  CYTHON_UNUSED PyObject *__pyx_v_pytz = NULL;
  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_t_5;
  __Pyx_RefNannySetupContext("_add_micros_maybe_localize", 0);
  __Pyx_INCREF(__pyx_v_dt);
  __Pyx_INCREF(__pyx_v_tzinfo);

  /* "pyarrow/scalar.pxi":304
 * 
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):
 *     import pytz             # <<<<<<<<<<<<<<
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":305
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):
 *     import pytz
 *     dt = dt.replace(microsecond=micros)             # <<<<<<<<<<<<<<
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_microsecond, __pyx_v_micros) < 0) __PYX_ERR(5, 305, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":306
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)
 */
  __pyx_t_4 = (__pyx_v_tzinfo != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/scalar.pxi":307
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_tzinfo, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
    if (__pyx_t_4) {

      /* "pyarrow/scalar.pxi":308
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)             # <<<<<<<<<<<<<<
 *         dt = tzinfo.fromutc(dt)
 *     return dt
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string_to_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_tzinfo) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tzinfo);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_tzinfo, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pyarrow/scalar.pxi":307
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)
 */
    }

    /* "pyarrow/scalar.pxi":309
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)             # <<<<<<<<<<<<<<
 *     return dt
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_fromutc); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_dt) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dt);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/scalar.pxi":306
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)
 */
  }

  /* "pyarrow/scalar.pxi":310
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)
 *     return dt             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dt);
  __pyx_r = __pyx_v_dt;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":303
 * 
 * 
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):             # <<<<<<<<<<<<<<
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._add_micros_maybe_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tzinfo);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":313
 * 
 * 
 * cdef _datetime_from_seconds(int64_t v):             # <<<<<<<<<<<<<<
 *     return datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=v)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib__datetime_from_seconds(int64_t __pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_datetime_from_seconds", 0);

  /* "pyarrow/scalar.pxi":314
 * 
 * cdef _datetime_from_seconds(int64_t v):
 *     return datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=v)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seconds, __pyx_t_4) < 0) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __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/scalar.pxi":313
 * 
 * 
 * cdef _datetime_from_seconds(int64_t v):             # <<<<<<<<<<<<<<
 *     return datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=v)
 * 
 */

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

/* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_111_nanoseconds_to_datetime_safe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_110_nanoseconds_to_datetime_safe[] = "_nanoseconds_to_datetime_safe(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_111_nanoseconds_to_datetime_safe = {"_nanoseconds_to_datetime_safe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_111_nanoseconds_to_datetime_safe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_110_nanoseconds_to_datetime_safe};
static PyObject *__pyx_pw_7pyarrow_3lib_111_nanoseconds_to_datetime_safe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_nanoseconds_to_datetime_safe (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_nanoseconds_to_datetime_safe", 1, 2, 2, 1); __PYX_ERR(5, 317, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_nanoseconds_to_datetime_safe") < 0)) __PYX_ERR(5, 317, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_nanoseconds_to_datetime_safe", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 317, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._nanoseconds_to_datetime_safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_110_nanoseconds_to_datetime_safe(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

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

static PyObject *__pyx_pf_7pyarrow_3lib_110_nanoseconds_to_datetime_safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_micros = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  __Pyx_RefNannySetupContext("_nanoseconds_to_datetime_safe", 0);
  __Pyx_INCREF(__pyx_v_v);

  /* "pyarrow/scalar.pxi":318
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 *                          " to microseconds to convert to datetime.datetime."
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/scalar.pxi":319
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "             # <<<<<<<<<<<<<<
 *                          " to microseconds to convert to datetime.datetime."
 *                          " Install pandas to return as Timestamp with "
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 319, __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(5, 319, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":318
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 *                          " to microseconds to convert to datetime.datetime."
 */
  }

  /* "pyarrow/scalar.pxi":323
 *                          " Install pandas to return as Timestamp with "
 *                          " nanosecond support or access the .value attribute.")
 *     v = v // 1000             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":324
 *                          " nanosecond support or access the .value attribute.")
 *     v = v // 1000
 *     micros = v % 1_000_000             # <<<<<<<<<<<<<<
 * 
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */
  __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_micros = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":326
 *     micros = v % 1_000_000
 * 
 *     dt = _datetime_from_seconds(v // 1_000_000)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":327
 * 
 *     dt = _datetime_from_seconds(v // 1_000_000)
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_v_micros, __pyx_v_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._nanoseconds_to_datetime_safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_micros);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_113_microseconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_112_microseconds_to_datetime[] = "_microseconds_to_datetime(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_113_microseconds_to_datetime = {"_microseconds_to_datetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_113_microseconds_to_datetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_112_microseconds_to_datetime};
static PyObject *__pyx_pw_7pyarrow_3lib_113_microseconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_microseconds_to_datetime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_microseconds_to_datetime", 1, 2, 2, 1); __PYX_ERR(5, 330, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_microseconds_to_datetime") < 0)) __PYX_ERR(5, 330, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_microseconds_to_datetime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 330, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._microseconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_112_microseconds_to_datetime(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

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

static PyObject *__pyx_pf_7pyarrow_3lib_112_microseconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_micros = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  __Pyx_RefNannySetupContext("_microseconds_to_datetime", 0);

  /* "pyarrow/scalar.pxi":331
 * 
 * def _microseconds_to_datetime(v, tzinfo):
 *     micros = v % 1_000_000             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v // 1_000_000)
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_micros = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":332
 * def _microseconds_to_datetime(v, tzinfo):
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":333
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_v_micros, __pyx_v_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._microseconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_micros);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_115_millis_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_114_millis_to_datetime[] = "_millis_to_datetime(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_115_millis_to_datetime = {"_millis_to_datetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_115_millis_to_datetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_114_millis_to_datetime};
static PyObject *__pyx_pw_7pyarrow_3lib_115_millis_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_millis_to_datetime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_millis_to_datetime", 1, 2, 2, 1); __PYX_ERR(5, 336, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_millis_to_datetime") < 0)) __PYX_ERR(5, 336, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_millis_to_datetime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 336, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._millis_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_114_millis_to_datetime(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

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

static PyObject *__pyx_pf_7pyarrow_3lib_114_millis_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_millis = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_millis_to_datetime", 0);

  /* "pyarrow/scalar.pxi":337
 * 
 * def _millis_to_datetime(v, tzinfo):
 *     millis = v % 1_000             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v // 1000)
 *     return _add_micros_maybe_localize(dt, millis * 1000, tzinfo)
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_millis = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":338
 * def _millis_to_datetime(v, tzinfo):
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, millis * 1000, tzinfo)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":339
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 *     return _add_micros_maybe_localize(dt, millis * 1000, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_millis, __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_t_1, __pyx_v_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 339, __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/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._millis_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_millis);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_117_seconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_116_seconds_to_datetime[] = "_seconds_to_datetime(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_117_seconds_to_datetime = {"_seconds_to_datetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_117_seconds_to_datetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_116_seconds_to_datetime};
static PyObject *__pyx_pw_7pyarrow_3lib_117_seconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_seconds_to_datetime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_seconds_to_datetime", 1, 2, 2, 1); __PYX_ERR(5, 342, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_seconds_to_datetime") < 0)) __PYX_ERR(5, 342, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_seconds_to_datetime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 342, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._seconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_116_seconds_to_datetime(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

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

static PyObject *__pyx_pf_7pyarrow_3lib_116_seconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_seconds_to_datetime", 0);

  /* "pyarrow/scalar.pxi":343
 * 
 * def _seconds_to_datetime(v, tzinfo):
 *     dt = _datetime_from_seconds(v)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_v); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 343, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":344
 * def _seconds_to_datetime(v, tzinfo):
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_int_0, __pyx_v_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._seconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_119_datetime_conversion_functions(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_118_datetime_conversion_functions[] = "_datetime_conversion_functions()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_119_datetime_conversion_functions = {"_datetime_conversion_functions", (PyCFunction)__pyx_pw_7pyarrow_3lib_119_datetime_conversion_functions, METH_NOARGS, __pyx_doc_7pyarrow_3lib_118_datetime_conversion_functions};
static PyObject *__pyx_pw_7pyarrow_3lib_119_datetime_conversion_functions(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_datetime_conversion_functions (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_118_datetime_conversion_functions(__pyx_self);

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

/* "pyarrow/scalar.pxi":362
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x, tz=tzinfo, unit='ns',
 *             )
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, 1); __PYX_ERR(5, 362, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(5, 362, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 362, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_pd)) { __Pyx_RaiseClosureNameError("pd"); __PYX_ERR(5, 362, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pd, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":363
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(
 *                 x, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 363, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_u_ns) < 0) __PYX_ERR(5, 363, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":362
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x, tz=tzinfo, unit='ns',
 *             )
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

static PyObject *__pyx_pf_7pyarrow_3lib_118_datetime_conversion_functions(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_cur_scope;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_datetime_conversion_functions", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 347, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/scalar.pxi":349
 * def _datetime_conversion_functions():
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:             # <<<<<<<<<<<<<<
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  __pyx_t_1 = (__pyx_v_7pyarrow_3lib__datetime_conversion_initialized != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":350
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 *         return _DATETIME_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 *     _DATETIME_CONVERSION_FUNCTIONS.update({
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
    __pyx_r = __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":349
 * def _datetime_conversion_functions():
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:             # <<<<<<<<<<<<<<
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  }

  /* "pyarrow/scalar.pxi":353
 * 
 *     _DATETIME_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: _seconds_to_datetime,             # <<<<<<<<<<<<<<
 *         TimeUnit_MILLI: _millis_to_datetime,
 *         TimeUnit_MICRO: _microseconds_to_datetime,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::SECOND); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_seconds_to_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":354
 *     _DATETIME_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: _seconds_to_datetime,
 *         TimeUnit_MILLI: _millis_to_datetime,             # <<<<<<<<<<<<<<
 *         TimeUnit_MICRO: _microseconds_to_datetime,
 *         TimeUnit_NANO: _nanoseconds_to_datetime_safe
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MILLI); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_millis_to_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":355
 *         TimeUnit_SECOND: _seconds_to_datetime,
 *         TimeUnit_MILLI: _millis_to_datetime,
 *         TimeUnit_MICRO: _microseconds_to_datetime,             # <<<<<<<<<<<<<<
 *         TimeUnit_NANO: _nanoseconds_to_datetime_safe
 *     })
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MICRO); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_microseconds_to_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":356
 *         TimeUnit_MILLI: _millis_to_datetime,
 *         TimeUnit_MICRO: _microseconds_to_datetime,
 *         TimeUnit_NANO: _nanoseconds_to_datetime_safe             # <<<<<<<<<<<<<<
 *     })
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_nanoseconds_to_datetime_safe); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":352
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 *     _DATETIME_CONVERSION_FUNCTIONS.update({             # <<<<<<<<<<<<<<
 *         TimeUnit_SECOND: _seconds_to_datetime,
 *         TimeUnit_MILLI: _millis_to_datetime,
 */
  __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":359
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
  {
    __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/scalar.pxi":360
 * 
 *     try:
 *         import pandas as pd             # <<<<<<<<<<<<<<
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(
 */
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 360, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_pd = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":362
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x, tz=tzinfo, unit='ns',
 *             )
 */
      __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_lambda, 0, __pyx_n_s_datetime_conversion_functions_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 362, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/scalar.pxi":361
 *     try:
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (             # <<<<<<<<<<<<<<
 *             lambda x, tzinfo: pd.Timestamp(
 *                 x, tz=tzinfo, unit='ns',
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 361, __pyx_L4_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 361, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(5, 361, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":359
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
    }
    __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_L9_try_end;
    __pyx_L4_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;

    /* "pyarrow/scalar.pxi":366
 *             )
 *         )
 *     except ImportError:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":359
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
    __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_L5_exception_handled:;
    __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);
    __pyx_L9_try_end:;
  }

  /* "pyarrow/scalar.pxi":369
 *         pass
 * 
 *     _datetime_conversion_initialized = True             # <<<<<<<<<<<<<<
 *     return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  __pyx_v_7pyarrow_3lib__datetime_conversion_initialized = 1;

  /* "pyarrow/scalar.pxi":370
 * 
 *     _datetime_conversion_initialized = True
 *     return _DATETIME_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
  __pyx_r = __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":379
 * 
 *     @property
 *     def value(self):             # <<<<<<<<<<<<<<
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_5value___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_5value___get__(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self) {
   arrow::TimestampArray *__pyx_v_ap;
  CYTHON_UNUSED  arrow::TimestampType *__pyx_v_dtype;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":380
 *     @property
 *     def value(self):
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 *         return ap.Value(self.index)
 */
  __pyx_v_ap = (( arrow::TimestampArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":381
 *     def value(self):
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_dtype = (( arrow::TimestampType *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":382
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":379
 * 
 *     @property
 *     def value(self):             # <<<<<<<<<<<<<<
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.TimestampValue.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":384
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_as_py[] = "TimestampValue.as_py(self)\n\n        Return this value as a Pandas Timestamp instance (if available),\n        otherwise as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self) {
   arrow::TimestampArray *__pyx_v_ap;
   arrow::TimestampType *__pyx_v_dtype;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_tzinfo = NULL;
  PyObject *__pyx_v_converter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  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_t_11;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":389
 *         otherwise as a Python datetime.timedelta instance.
 *         """
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::TimestampArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":390
 *         """
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()             # <<<<<<<<<<<<<<
 * 
 *         value = self.value
 */
  __pyx_v_dtype = (( arrow::TimestampType *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":392
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 * 
 *         value = self.value             # <<<<<<<<<<<<<<
 * 
 *         if not dtype.timezone().empty():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":394
 *         value = self.value
 * 
 *         if not dtype.timezone().empty():             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 */
  __pyx_t_2 = ((!(__pyx_v_dtype->timezone().empty() != 0)) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":395
 * 
 *         if not dtype.timezone().empty():
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))             # <<<<<<<<<<<<<<
 *         else:
 *             tzinfo = None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string_to_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_dtype->timezone()); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_tzinfo = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/scalar.pxi":394
 *         value = self.value
 * 
 *         if not dtype.timezone().empty():             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/scalar.pxi":397
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 *             tzinfo = None             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_tzinfo = Py_None;
  }
  __pyx_L3:;

  /* "pyarrow/scalar.pxi":399
 *             tzinfo = None
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 */
  {
    __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:*/ {

      /* "pyarrow/scalar.pxi":400
 * 
 *         try:
 *             converter = _datetime_conversion_functions()[dtype.unit()]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             raise ValueError(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime_conversion_functions); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_dtype->unit()); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_converter = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/scalar.pxi":399
 *             tzinfo = None
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __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/scalar.pxi":401
 *         try:
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'Cannot convert nanosecond timestamps without pandas'
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pyarrow.lib.TimestampValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(5, 401, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/scalar.pxi":402
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 402, __pyx_L6_except_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(5, 402, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":399
 *             tzinfo = None
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "pyarrow/scalar.pxi":405
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 *         return converter(value, tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 405, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_converter, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":384
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.TimestampValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_tzinfo);
  __Pyx_XDECREF(__pyx_v_converter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_2__reduce_cython__[] = "TimestampValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_4__setstate_cython__[] = "TimestampValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":413
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_as_py[] = "HalfFloatValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self) {
   arrow::HalfFloatArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":417
 *         Return this value as a Python float.
 *         """
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return PyHalf_FromHalf(ap.Value(self.index))
 * 
 */
  __pyx_v_ap = (( arrow::HalfFloatArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":418
 *         """
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()
 *         return PyHalf_FromHalf(ap.Value(self.index))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::PyHalf_FromHalf(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":413
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HalfFloatValue.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__[] = "HalfFloatValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__[] = "HalfFloatValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":426
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_as_py[] = "FloatValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_as_py(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self) {
   arrow::FloatArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":430
 *         Return this value as a Python float.
 *         """
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::FloatArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":431
 *         """
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":426
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatValue.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_2__reduce_cython__[] = "FloatValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_4__setstate_cython__[] = "FloatValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":439
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_as_py[] = "DoubleValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self) {
   arrow::DoubleArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":443
 *         Return this value as a Python float.
 *         """
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::DoubleArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":444
 *         """
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":439
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleValue.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_2__reduce_cython__[] = "DoubleValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_4__setstate_cython__[] = "DoubleValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":452
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python Decimal.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_as_py[] = "DecimalValue.as_py(self)\n\n        Return this value as a Python Decimal.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self) {
   arrow::Decimal128Array *__pyx_v_ap;
  std::string __pyx_v_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":457
 *         """
 *         cdef:
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             c_string s = ap.FormatValue(self.index)
 *         return _pydecimal.Decimal(s.decode('utf8'))
 */
  __pyx_v_ap = (( arrow::Decimal128Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":458
 *         cdef:
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()
 *             c_string s = ap.FormatValue(self.index)             # <<<<<<<<<<<<<<
 *         return _pydecimal.Decimal(s.decode('utf8'))
 * 
 */
  __pyx_v_s = __pyx_v_ap->FormatValue(__pyx_v_self->__pyx_base.index);

  /* "pyarrow/scalar.pxi":459
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()
 *             c_string s = ap.FormatValue(self.index)
 *         return _pydecimal.Decimal(s.decode('utf8'))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pydecimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __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(5, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":452
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python Decimal.
 */

  /* 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.lib.DecimalValue.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_2__reduce_cython__[] = "DecimalValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_4__setstate_cython__[] = "DecimalValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":467
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_as_py[] = "StringValue.as_py(self)\n\n        Return this value as a Python unicode string.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_as_py(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_as_py(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self) {
   arrow::StringArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":471
 *         Return this value as a Python unicode string.
 *         """
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 */
  __pyx_v_ap = (( arrow::StringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":472
 *         """
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()
 *         return ap.GetString(self.index).decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_ap->GetString(__pyx_v_self->__pyx_base.index), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":467
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":474
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_2as_buffer[] = "StringValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self) {
   arrow::StringArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":479
 *         """
 *         cdef:
 *             CStringArray* ap = <CStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::StringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":482
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":484
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":474
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringValue.as_buffer", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_4__reduce_cython__[] = "StringValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_6__setstate_cython__[] = "StringValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":492
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_as_py[] = "LargeStringValue.as_py(self)\n\n        Return this value as a Python unicode string.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_as_py(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self) {
   arrow::LargeStringArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":496
 *         Return this value as a Python unicode string.
 *         """
 *         cdef CLargeStringArray* ap = <CLargeStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 */
  __pyx_v_ap = (( arrow::LargeStringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":497
 *         """
 *         cdef CLargeStringArray* ap = <CLargeStringArray*> self.sp_array.get()
 *         return ap.GetString(self.index).decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_ap->GetString(__pyx_v_self->__pyx_base.index), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":492
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":499
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_2as_buffer[] = "LargeStringValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self) {
   arrow::LargeStringArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":504
 *         """
 *         cdef:
 *             CLargeStringArray* ap = <CLargeStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::LargeStringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":507
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":509
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":499
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringValue.as_buffer", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__[] = "LargeStringValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__[] = "LargeStringValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":517
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_as_py[] = "BinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
  uint8_t const *__pyx_v_ptr;
  int32_t __pyx_v_length;
   arrow::BinaryArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":524
 *             const uint8_t* ptr
 *             int32_t length
 *             CBinaryArray* ap = <CBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *         ptr = ap.GetValue(self.index, &length)
 */
  __pyx_v_ap = (( arrow::BinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":526
 *             CBinaryArray* ap = <CBinaryArray*> self.sp_array.get()
 * 
 *         ptr = ap.GetValue(self.index, &length)             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 */
  __pyx_v_ptr = __pyx_v_ap->GetValue(__pyx_v_self->__pyx_base.index, (&__pyx_v_length));

  /* "pyarrow/scalar.pxi":527
 * 
 *         ptr = ap.GetValue(self.index, &length)
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_ptr), __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":517
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":529
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_2as_buffer[] = "BinaryValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
   arrow::BinaryArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":534
 *         """
 *         cdef:
 *             CBinaryArray* ap = <CBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::BinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":537
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":539
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":529
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.as_buffer", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_4__reduce_cython__[] = "BinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_6__setstate_cython__[] = "BinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":547
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_as_py[] = "LargeBinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self) {
  uint8_t const *__pyx_v_ptr;
  int64_t __pyx_v_length;
   arrow::LargeBinaryArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":554
 *             const uint8_t* ptr
 *             int64_t length
 *             CLargeBinaryArray* ap = <CLargeBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *         ptr = ap.GetValue(self.index, &length)
 */
  __pyx_v_ap = (( arrow::LargeBinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":556
 *             CLargeBinaryArray* ap = <CLargeBinaryArray*> self.sp_array.get()
 * 
 *         ptr = ap.GetValue(self.index, &length)             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 */
  __pyx_v_ptr = __pyx_v_ap->GetValue(__pyx_v_self->__pyx_base.index, (&__pyx_v_length));

  /* "pyarrow/scalar.pxi":557
 * 
 *         ptr = ap.GetValue(self.index, &length)
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_ptr), __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":547
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeBinaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":559
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_2as_buffer[] = "LargeBinaryValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self) {
   arrow::LargeBinaryArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":564
 *         """
 *         cdef:
 *             CLargeBinaryArray* ap = <CLargeBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::LargeBinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":567
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":569
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":559
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeBinaryValue.as_buffer", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__[] = "LargeBinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__[] = "LargeBinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":577
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9ListValue_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue___len__[] = "\n        Return the number of values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9ListValue_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue___len__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_9ListValue___len__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/scalar.pxi":581
 *         Return the number of values.
 *         """
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":577
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

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

/* "pyarrow/scalar.pxi":583
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_2__getitem__[] = "\n        Return the value at the given index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":587
 *         Return the value at the given index.
 *         """
 *         return self.getitem(_normalize_index(i, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 587, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 587, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":583
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_9ListValue_6generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/scalar.pxi":589
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_4__iter__[] = "\n        Iterate over this element's values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 589, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_9ListValue_6generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ListValue___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 589, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListValue.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_9ListValue_6generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 589, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":593
 *         Iterate over this element's values.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 *         raise StopIteration
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 593, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/scalar.pxi":594
 *         """
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 594, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":595
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(5, 595, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":589
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":597
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_9ListValue__set_array(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":598
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":599
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()             # <<<<<<<<<<<<<<
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 */
  __pyx_v_self->ap = (( arrow::ListArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":600
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 600, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->value_type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_v_self->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":597
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.ListValue._set_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":602
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

static PyObject *__pyx_f_7pyarrow_3lib_9ListValue_getitem(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, int64_t __pyx_v_i) {
  int64_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":603
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i             # <<<<<<<<<<<<<<
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 */
  __pyx_v_j = (__pyx_v_self->ap->value_offset(__pyx_v_self->__pyx_base.index) + __pyx_v_i);

  /* "pyarrow/scalar.pxi":604
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->value_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->values(), __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 604, __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/scalar.pxi":602
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":606
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

static int64_t __pyx_f_7pyarrow_3lib_9ListValue_length(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/scalar.pxi":607
 * 
 *     cdef int64_t length(self):
 *         return self.ap.value_length(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __pyx_r = __pyx_v_self->ap->value_length(__pyx_v_self->__pyx_base.index);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":606
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

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

/* "pyarrow/scalar.pxi":609
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_7as_py[] = "ListValue.as_py(self)\n\n        Return this value as a Python list.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_7as_py(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  int64_t __pyx_v_j;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":615
 *         cdef:
 *             int64_t j
 *             list result = []             # <<<<<<<<<<<<<<
 * 
 *         for j in range(len(self)):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":617
 *             list result = []
 * 
 *         for j in range(len(self)):             # <<<<<<<<<<<<<<
 *             result.append(self.getitem(j).as_py())
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 617, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_j = __pyx_t_4;

    /* "pyarrow/scalar.pxi":618
 * 
 *         for j in range(len(self)):
 *             result.append(self.getitem(j).as_py())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 618, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/scalar.pxi":620
 *             result.append(self.getitem(j).as_py())
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":609
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":187
 * cdef class ListValue(ArrayValue):
 *     cdef readonly:
 *         DataType value_type             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_r = ((PyObject *)__pyx_v_self->value_type);
  goto __pyx_L0;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_9__reduce_cython__[] = "ListValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_11__setstate_cython__[] = "ListValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":628
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue___len__[] = "\n        Return the number of values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue___len__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_14LargeListValue___len__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/scalar.pxi":632
 *         Return the number of values.
 *         """
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":628
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

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

/* "pyarrow/scalar.pxi":634
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_2__getitem__[] = "\n        Return the value at the given index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_2__getitem__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":638
 *         Return the value at the given index.
 *         """
 *         return self.getitem(_normalize_index(i, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 638, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 638, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":634
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_14LargeListValue_6generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/scalar.pxi":640
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_4__iter__[] = "\n        Iterate over this element's values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_4__iter__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 640, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_14LargeListValue_6generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_LargeListValue___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 640, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_14LargeListValue_6generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 640, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":644
 *         Iterate over this element's values.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 *         raise StopIteration
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 644, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/scalar.pxi":645
 *         """
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 645, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":646
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(5, 646, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":640
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":648
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_14LargeListValue__set_array(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":649
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CLargeListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":650
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()             # <<<<<<<<<<<<<<
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 */
  __pyx_v_self->ap = (( arrow::LargeListArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":651
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 651, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->value_type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_v_self->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":648
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.LargeListValue._set_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":653
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

static PyObject *__pyx_f_7pyarrow_3lib_14LargeListValue_getitem(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, int64_t __pyx_v_i) {
  int64_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":654
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i             # <<<<<<<<<<<<<<
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 */
  __pyx_v_j = (__pyx_v_self->ap->value_offset(__pyx_v_self->__pyx_base.index) + __pyx_v_i);

  /* "pyarrow/scalar.pxi":655
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->value_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->values(), __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 655, __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/scalar.pxi":653
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":657
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

static int64_t __pyx_f_7pyarrow_3lib_14LargeListValue_length(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/scalar.pxi":658
 * 
 *     cdef int64_t length(self):
 *         return self.ap.value_length(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __pyx_r = __pyx_v_self->ap->value_length(__pyx_v_self->__pyx_base.index);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":657
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

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

/* "pyarrow/scalar.pxi":660
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_7as_py[] = "LargeListValue.as_py(self)\n\n        Return this value as a Python list.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_7as_py(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  int64_t __pyx_v_j;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":666
 *         cdef:
 *             int64_t j
 *             list result = []             # <<<<<<<<<<<<<<
 * 
 *         for j in range(len(self)):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":668
 *             list result = []
 * 
 *         for j in range(len(self)):             # <<<<<<<<<<<<<<
 *             result.append(self.getitem(j).as_py())
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 668, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_j = __pyx_t_4;

    /* "pyarrow/scalar.pxi":669
 * 
 *         for j in range(len(self)):
 *             result.append(self.getitem(j).as_py())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/scalar.pxi":671
 *             result.append(self.getitem(j).as_py())
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":660
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":198
 * cdef class LargeListValue(ArrayValue):
 *     cdef readonly:
 *         DataType value_type             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_r = ((PyObject *)__pyx_v_self->value_type);
  goto __pyx_L0;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_9__reduce_cython__[] = "LargeListValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_11__setstate_cython__[] = "LargeListValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

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

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

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

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

/* "pyarrow/scalar.pxi":679
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CUnionArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_10UnionValue__set_array(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":680
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":681
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CUnionArray*> sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_v_self->ap = (( arrow::UnionArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":679
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CUnionArray*> sp_array.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":683
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 */

static PyObject *__pyx_f_7pyarrow_3lib_10UnionValue_getitem(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, int64_t __pyx_v_i) {
  int8_t __pyx_v_type_id;
  std::shared_ptr< arrow::Array>  __pyx_v_child;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":684
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:
 */
  __pyx_v_type_id = (__pyx_v_self->ap->raw_type_ids()[__pyx_v_i]);

  /* "pyarrow/scalar.pxi":685
 *     cdef getitem(self, int64_t i):
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)             # <<<<<<<<<<<<<<
 *         if self.ap.mode() == _UnionMode_SPARSE:
 *             return box_scalar(self.type[type_id].type, child, i)
 */
  __pyx_v_child = __pyx_v_self->ap->child(__pyx_v_type_id);

  /* "pyarrow/scalar.pxi":686
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return box_scalar(self.type[type_id].type, child, i)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->ap->mode() ==  arrow::UnionMode::SPARSE) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":687
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:
 *             return box_scalar(self.type[type_id].type, child, i)             # <<<<<<<<<<<<<<
 *         else:
 *             return box_scalar(self.type[type_id].type, child,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.type), __pyx_v_type_id, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 687, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3), __pyx_v_child, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 687, __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/scalar.pxi":686
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return box_scalar(self.type[type_id].type, child, i)
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":689
 *             return box_scalar(self.type[type_id].type, child, i)
 *         else:
 *             return box_scalar(self.type[type_id].type, child,             # <<<<<<<<<<<<<<
 *                               self.ap.value_offset(i))
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.type), __pyx_v_type_id, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 689, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":690
 *         else:
 *             return box_scalar(self.type[type_id].type, child,
 *                               self.ap.value_offset(i))             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3), __pyx_v_child, __pyx_v_self->ap->value_offset(__pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 689, __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/scalar.pxi":683
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":692
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_as_py[] = "UnionValue.as_py(self)\n\n        Return this value as a Python object.\n\n        The exact type depends on the underlying union member.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_as_py(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_as_py(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":698
 *         The exact type depends on the underlying union member.
 *         """
 *         return self.getitem(self.index).as_py()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":692
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.as_py", __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.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_2__reduce_cython__[] = "UnionValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.__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.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_4__setstate_cython__[] = "UnionValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":706
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_as_py[] = "FixedSizeBinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self) {
   arrow::FixedSizeBinaryArray *__pyx_v_ap;
   arrow::FixedSizeBinaryType *__pyx_v_ap_type;
  int32_t __pyx_v_length;
  char const *__pyx_v_data;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":715
 *             int32_t length
 *             const char* data
 *         ap = <CFixedSizeBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()
 *         length = ap_type.byte_width()
 */
  __pyx_v_ap = (( arrow::FixedSizeBinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":716
 *             const char* data
 *         ap = <CFixedSizeBinaryArray*> self.sp_array.get()
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()             # <<<<<<<<<<<<<<
 *         length = ap_type.byte_width()
 *         data = <const char*> ap.GetValue(self.index)
 */
  __pyx_v_ap_type = (( arrow::FixedSizeBinaryType *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":717
 *         ap = <CFixedSizeBinaryArray*> self.sp_array.get()
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()
 *         length = ap_type.byte_width()             # <<<<<<<<<<<<<<
 *         data = <const char*> ap.GetValue(self.index)
 *         return cp.PyBytes_FromStringAndSize(data, length)
 */
  __pyx_v_length = __pyx_v_ap_type->byte_width();

  /* "pyarrow/scalar.pxi":718
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()
 *         length = ap_type.byte_width()
 *         data = <const char*> ap.GetValue(self.index)             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(data, length)
 * 
 */
  __pyx_v_data = ((char const *)__pyx_v_ap->GetValue(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":719
 *         length = ap_type.byte_width()
 *         data = <const char*> ap.GetValue(self.index)
 *         return cp.PyBytes_FromStringAndSize(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_data, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":706
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryValue.as_py", __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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__[] = "FixedSizeBinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryValue.__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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__[] = "FixedSizeBinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":727
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CStructArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_11StructValue__set_array(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":728
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":729
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CStructArray*> sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __pyx_v_self->ap = (( arrow::StructArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":727
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CStructArray*> sp_array.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":731
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Return the child value for the given field name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue___getitem__[] = "\n        Return the child value for the given field name.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue___getitem__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue___getitem__(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, PyObject *__pyx_v_key) {
   arrow::StructType *__pyx_v_type;
  int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":739
 *             int index
 * 
 *         type = <CStructType*> self.type.type             # <<<<<<<<<<<<<<
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 */
  __pyx_v_type = (( arrow::StructType *)__pyx_v_self->__pyx_base.__pyx_base.type->type);

  /* "pyarrow/scalar.pxi":740
 * 
 *         type = <CStructType*> self.type.type
 *         index = type.GetFieldIndex(tobytes(key))             # <<<<<<<<<<<<<<
 * 
 *         if index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_index = __pyx_v_type->GetFieldIndex(__pyx_t_4);

  /* "pyarrow/scalar.pxi":742
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  __pyx_t_5 = ((__pyx_v_index < 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/scalar.pxi":743
 * 
 *         if index < 0:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 743, __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(5, 743, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":742
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  }

  /* "pyarrow/scalar.pxi":745
 *             raise KeyError(key)
 * 
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->ap->field(__pyx_v_index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 745, __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/scalar.pxi":731
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Return the child value for the given field name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":747
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python dict.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_3as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_2as_py[] = "StructValue.as_py(self)\n\n        Return this value as a Python dict.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_3as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_2as_py(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_2as_py(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_child_fields;
  PyObject *__pyx_v_wrapped_arrays = NULL;
  PyObject *__pyx_v_child_names = NULL;
  int __pyx_8genexpr2__pyx_v_i;
  std::shared_ptr< arrow::Field>  __pyx_8genexpr3__pyx_v_child;
  PyObject *__pyx_8genexpr4__pyx_v_name = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_child_array = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  std::vector<std::shared_ptr< arrow::Field> > ::iterator __pyx_t_6;
  std::shared_ptr< arrow::Field>  __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":752
 *         """
 *         cdef:
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()             # <<<<<<<<<<<<<<
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 */
  __pyx_v_child_fields = __pyx_v_self->__pyx_base.__pyx_base.type->type->children();

  /* "pyarrow/scalar.pxi":754
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))             # <<<<<<<<<<<<<<
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/scalar.pxi":755
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 *                           for i in range(self.ap.num_fields())]             # <<<<<<<<<<<<<<
 *         child_names = [child.get().name() for child in child_fields]
 *         # Return the struct as a dict
 */
    __pyx_t_2 = __pyx_v_self->ap->num_fields();
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr2__pyx_v_i = __pyx_t_4;

      /* "pyarrow/scalar.pxi":754
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))             # <<<<<<<<<<<<<<
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->ap->field(__pyx_8genexpr2__pyx_v_i)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 754, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_wrapped_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":756
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]             # <<<<<<<<<<<<<<
 *         # Return the struct as a dict
 *         return {
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __pyx_v_child_fields.begin();
    for (;;) {
      if (!(__pyx_t_6 != __pyx_v_child_fields.end())) break;
      __pyx_t_7 = *__pyx_t_6;
      ++__pyx_t_6;
      __pyx_8genexpr3__pyx_v_child = __pyx_t_7;
      __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_8genexpr3__pyx_v_child.get()->name()); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 756, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_child_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":758
 *         child_names = [child.get().name() for child in child_fields]
 *         # Return the struct as a dict
 *         return {             # <<<<<<<<<<<<<<
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 758, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/scalar.pxi":761
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in
 *             zip(child_names, wrapped_arrays)             # <<<<<<<<<<<<<<
 *         }
 * 
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 761, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_child_names);
    __Pyx_GIVEREF(__pyx_v_child_names);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_child_names);
    __Pyx_INCREF(__pyx_v_wrapped_arrays);
    __Pyx_GIVEREF(__pyx_v_wrapped_arrays);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_wrapped_arrays);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 761, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 761, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 761, __pyx_L9_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(5, 761, __pyx_L9_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 761, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(5, 761, __pyx_L9_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 761, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(5, 761, __pyx_L9_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        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(5, 760, __pyx_L9_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 760, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 760, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 760, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(5, 760, __pyx_L9_error)
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(5, 760, __pyx_L9_error)
        __pyx_L13_unpacking_done:;
      }

      /* "pyarrow/scalar.pxi":760
 *         return {
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in             # <<<<<<<<<<<<<<
 *             zip(child_names, wrapped_arrays)
 *         }
 */
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_name, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_child_array, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":759
 *         # Return the struct as a dict
 *         return {
 *             frombytes(name): child_array[self.index].as_py()             # <<<<<<<<<<<<<<
 *             for name, child_array in
 *             zip(child_names, wrapped_arrays)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 759, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_8genexpr4__pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_8genexpr4__pyx_v_name);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 759, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_8genexpr4__pyx_v_child_array, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 759, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_as_py); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 759, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 759, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_8, (PyObject*)__pyx_t_12))) __PYX_ERR(5, 759, __pyx_L9_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":760
 *         return {
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in             # <<<<<<<<<<<<<<
 *             zip(child_names, wrapped_arrays)
 *         }
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array); __pyx_8genexpr4__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array); __pyx_8genexpr4__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":747
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python dict.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrapped_arrays);
  __Pyx_XDECREF(__pyx_v_child_names);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_4__reduce_cython__[] = "StructValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.__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.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_6__setstate_cython__[] = "StructValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":770
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_as_py[] = "DictionaryValue.as_py(self)\n\n        Return this value as a Python object.\n\n        The exact type depends on the dictionary value type.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":776
 *         The exact type depends on the dictionary value type.
 *         """
 *         return self.dictionary_value.as_py()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dictionary_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":770
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":779
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying index as a ArrayValue of the right
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":784
 *         signed integer type.
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())             # <<<<<<<<<<<<<<
 *         indices = pyarrow_wrap_array(darr.indices())
 *         return indices[self.index]
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":785
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())             # <<<<<<<<<<<<<<
 *         return indices[self.index]
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->indices()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":786
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())
 *         return indices[self.index]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indices, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":779
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying index as a ArrayValue of the right
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.index_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":789
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying dictionary value as a ArrayValue.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_v_dictionary = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":793
 *         Return this value's underlying dictionary value as a ArrayValue.
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())             # <<<<<<<<<<<<<<
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 *         return dictionary[self.index_value.as_py()]
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":794
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())             # <<<<<<<<<<<<<<
 *         return dictionary[self.index_value.as_py()]
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->dictionary()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dictionary = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":795
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 *         return dictionary[self.index_value.as_py()]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_dictionary, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 795, __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/scalar.pxi":789
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying dictionary value as a ArrayValue.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.dictionary_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dictionary);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__[] = "DictionaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.__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.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__[] = "DictionaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":834
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/scalar.pxi":836
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_6, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":835
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly."             # <<<<<<<<<<<<<<
 *                         .format(self.__class__.__name__))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(5, 835, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":834
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":838
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *         self.sp_scalar = sp_scalar
 * 
 */

static void __pyx_f_7pyarrow_3lib_11ScalarValue_init(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/scalar.pxi":839
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):
 *         self.sp_scalar = sp_scalar             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_v_self->sp_scalar = __pyx_v_sp_scalar;

  /* "pyarrow/scalar.pxi":838
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *         self.sp_scalar = sp_scalar
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":841
 *         self.sp_scalar = sp_scalar
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/scalar.pxi":842
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 842, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":843
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__repr__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":842
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":845
 *             return repr(self.as_py())
 *         else:
 *             return super(Scalar, self).__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":841
 *         self.sp_scalar = sp_scalar
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":847
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/scalar.pxi":848
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 848, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":849
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__str__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":848
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":851
 *             return str(self.as_py())
 *         else:
 *             return super(Scalar, self).__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":847
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":853
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __Pyx_INCREF(__pyx_v_other);

  /* "pyarrow/scalar.pxi":854
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 854, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/scalar.pxi":855
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_ScalarValue); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/scalar.pxi":856
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()             # <<<<<<<<<<<<<<
 *             return self.as_py() == other
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":855
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    }

    /* "pyarrow/scalar.pxi":857
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 *             return self.as_py() == other             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplemented(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 857, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":854
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 */
  }

  /* "pyarrow/scalar.pxi":859
 *             return self.as_py() == other
 *         else:
 *             raise NotImplemented(             # <<<<<<<<<<<<<<
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 859, __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(5, 859, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":853
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":862
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_hash_t __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/scalar.pxi":863
 * 
 *     def __hash__(self):
 *         return hash(self.as_py())             # <<<<<<<<<<<<<<
 * 
 * cdef class UInt8Scalar(ScalarValue):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(5, 863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":862
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11ScalarValue_10__reduce_cython__[] = "ScalarValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11ScalarValue_12__setstate_cython__[] = "ScalarValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":870
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_as_py[] = "UInt8Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self) {
   arrow::UInt8Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":874
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt8Scalar* sp = <CUInt8Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt8Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":875
 *         """
 *         cdef CUInt8Scalar* sp = <CUInt8Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":870
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__[] = "UInt8Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__[] = "UInt8Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":883
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_as_py[] = "Int8Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self) {
   arrow::Int8Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":887
 *         Return this value as a Python int.
 *         """
 *         cdef CInt8Scalar* sp = <CInt8Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int8Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":888
 *         """
 *         cdef CInt8Scalar* sp = <CInt8Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":883
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__[] = "Int8Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__[] = "Int8Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":896
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_as_py[] = "UInt16Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self) {
   arrow::UInt16Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":900
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt16Scalar* sp = <CUInt16Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt16Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":901
 *         """
 *         cdef CUInt16Scalar* sp = <CUInt16Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":896
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__[] = "UInt16Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__[] = "UInt16Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":909
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_as_py[] = "Int16Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self) {
   arrow::Int16Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":913
 *         Return this value as a Python int.
 *         """
 *         cdef CInt16Scalar* sp = <CInt16Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int16Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":914
 *         """
 *         cdef CInt16Scalar* sp = <CInt16Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":909
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__[] = "Int16Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__[] = "Int16Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":922
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_as_py[] = "UInt32Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self) {
   arrow::UInt32Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":926
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt32Scalar* sp = <CUInt32Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt32Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":927
 *         """
 *         cdef CUInt32Scalar* sp = <CUInt32Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":922
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__[] = "UInt32Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__[] = "UInt32Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":935
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_as_py[] = "Int32Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self) {
   arrow::Int32Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":939
 *         Return this value as a Python int.
 *         """
 *         cdef CInt32Scalar* sp = <CInt32Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int32Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":940
 *         """
 *         cdef CInt32Scalar* sp = <CInt32Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":935
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__[] = "Int32Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__[] = "Int32Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":948
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_as_py[] = "UInt64Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self) {
   arrow::UInt64Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":952
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt64Scalar* sp = <CUInt64Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt64Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":953
 *         """
 *         cdef CUInt64Scalar* sp = <CUInt64Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":948
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__[] = "UInt64Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__[] = "UInt64Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":961
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_as_py[] = "Int64Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self) {
   arrow::Int64Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":965
 *         Return this value as a Python int.
 *         """
 *         cdef CInt64Scalar* sp = <CInt64Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int64Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":966
 *         """
 *         cdef CInt64Scalar* sp = <CInt64Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":961
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__[] = "Int64Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__[] = "Int64Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":974
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_as_py[] = "FloatScalar.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self) {
   arrow::FloatScalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":978
 *         Return this value as a Python float.
 *         """
 *         cdef CFloatScalar* sp = <CFloatScalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::FloatScalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":979
 *         """
 *         cdef CFloatScalar* sp = <CFloatScalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":974
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_2__reduce_cython__[] = "FloatScalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_4__setstate_cython__[] = "FloatScalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":987
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_as_py[] = "DoubleScalar.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self) {
   arrow::DoubleScalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":991
 *         Return this value as a Python float.
 *         """
 *         cdef CDoubleScalar* sp = <CDoubleScalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::DoubleScalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":992
 *         """
 *         cdef CDoubleScalar* sp = <CDoubleScalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":987
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.as_py", __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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__[] = "DoubleScalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.__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.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__[] = "DoubleScalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1008
 * }
 * 
 * cdef object box_scalar(DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                        int64_t index):
 *     cdef ArrayValue value
 */

static PyObject *__pyx_f_7pyarrow_3lib_box_scalar(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array, int64_t __pyx_v_index) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_value = 0;
  PyObject *__pyx_v_klass = 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;
  __Pyx_RefNannySetupContext("box_scalar", 0);

  /* "pyarrow/scalar.pxi":1012
 *     cdef ArrayValue value
 * 
 *     if type.type.id() == _Type_NA:             # <<<<<<<<<<<<<<
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 */
  __pyx_t_1 = ((__pyx_v_type->type->id() ==  arrow::Type::NA) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":1013
 * 
 *     if type.type.id() == _Type_NA:
 *         return _NULL             # <<<<<<<<<<<<<<
 *     elif sp_array.get().IsNull(index):
 *         return _NULL
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NULL_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":1012
 *     cdef ArrayValue value
 * 
 *     if type.type.id() == _Type_NA:             # <<<<<<<<<<<<<<
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 */
  }

  /* "pyarrow/scalar.pxi":1014
 *     if type.type.id() == _Type_NA:
 *         return _NULL
 *     elif sp_array.get().IsNull(index):             # <<<<<<<<<<<<<<
 *         return _NULL
 *     else:
 */
  __pyx_t_1 = (__pyx_v_sp_array.get()->IsNull(__pyx_v_index) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":1015
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 *         return _NULL             # <<<<<<<<<<<<<<
 *     else:
 *         klass = _array_value_classes[type.type.id()]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NULL_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":1014
 *     if type.type.id() == _Type_NA:
 *         return _NULL
 *     elif sp_array.get().IsNull(index):             # <<<<<<<<<<<<<<
 *         return _NULL
 *     else:
 */
  }

  /* "pyarrow/scalar.pxi":1017
 *         return _NULL
 *     else:
 *         klass = _array_value_classes[type.type.id()]             # <<<<<<<<<<<<<<
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)
 */
  /*else*/ {
    if (unlikely(__pyx_v_7pyarrow_3lib__array_value_classes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(5, 1017, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type->type->id()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__array_value_classes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_klass = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":1018
 *     else:
 *         klass = _array_value_classes[type.type.id()]
 *         value = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *         value.init(type, sp_array, index)
 *         return value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_klass) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_klass);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ArrayValue))))) __PYX_ERR(5, 1018, __pyx_L1_error)
    __pyx_v_value = ((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":1019
 *         klass = _array_value_classes[type.type.id()]
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)             # <<<<<<<<<<<<<<
 *         return value
 */
    ((struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *)__pyx_v_value->__pyx_vtab)->init(__pyx_v_value, __pyx_v_type, __pyx_v_sp_array, __pyx_v_index);

    /* "pyarrow/scalar.pxi":1020
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)
 *         return value             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_value));
    __pyx_r = ((PyObject *)__pyx_v_value);
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":1008
 * }
 * 
 * cdef object box_scalar(DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                        int64_t index):
 *     cdef ArrayValue value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.box_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":19
 * 
 * 
 * cdef _sequence_to_array(object sequence, object mask, object size,             # <<<<<<<<<<<<<<
 *                         DataType type, CMemoryPool* pool, c_bool from_pandas):
 *     cdef int64_t c_size
 */

static PyObject *__pyx_f_7pyarrow_3lib__sequence_to_array(PyObject *__pyx_v_sequence, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type,  arrow::MemoryPool *__pyx_v_pool, bool __pyx_v_from_pandas) {
  arrow::py::PyConversionOptions __pyx_v_options;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::shared_ptr< arrow::DataType>  __pyx_t_3;
  int64_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_sequence_to_array", 0);

  /* "pyarrow/array.pxi":24
 *     cdef PyConversionOptions options
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         options.type = type.sp_type
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_type) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":25
 * 
 *     if type is not None:
 *         options.type = type.sp_type             # <<<<<<<<<<<<<<
 * 
 *     if size is not None:
 */
    __pyx_t_3 = __pyx_v_type->sp_type;
    __pyx_v_options.type = __pyx_t_3;

    /* "pyarrow/array.pxi":24
 *     cdef PyConversionOptions options
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         options.type = type.sp_type
 * 
 */
  }

  /* "pyarrow/array.pxi":27
 *         options.type = type.sp_type
 * 
 *     if size is not None:             # <<<<<<<<<<<<<<
 *         options.size = size
 * 
 */
  __pyx_t_2 = (__pyx_v_size != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":28
 * 
 *     if size is not None:
 *         options.size = size             # <<<<<<<<<<<<<<
 * 
 *     options.pool = pool
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_size); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error)
    __pyx_v_options.size = __pyx_t_4;

    /* "pyarrow/array.pxi":27
 *         options.type = type.sp_type
 * 
 *     if size is not None:             # <<<<<<<<<<<<<<
 *         options.size = size
 * 
 */
  }

  /* "pyarrow/array.pxi":30
 *         options.size = size
 * 
 *     options.pool = pool             # <<<<<<<<<<<<<<
 *     options.from_pandas = from_pandas
 * 
 */
  __pyx_v_options.pool = __pyx_v_pool;

  /* "pyarrow/array.pxi":31
 * 
 *     options.pool = pool
 *     options.from_pandas = from_pandas             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CChunkedArray] out
 */
  __pyx_v_options.from_pandas = __pyx_v_from_pandas;

  /* "pyarrow/array.pxi":35
 *     cdef shared_ptr[CChunkedArray] out
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":36
 * 
 *     with nogil:
 *         check_status(ConvertPySequence(sequence, mask, options, &out))             # <<<<<<<<<<<<<<
 * 
 *     if out.get().num_chunks() == 1:
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertPySequence(__pyx_v_sequence, __pyx_v_mask, __pyx_v_options, (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 36, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":35
 *     cdef shared_ptr[CChunkedArray] out
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/array.pxi":38
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 *     if out.get().num_chunks() == 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(out.get().chunk(0))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_out.get()->num_chunks() == 1) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":39
 * 
 *     if out.get().num_chunks() == 1:
 *         return pyarrow_wrap_array(out.get().chunk(0))             # <<<<<<<<<<<<<<
 *     else:
 *         return pyarrow_wrap_chunked_array(out)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out.get()->chunk(0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":38
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 *     if out.get().num_chunks() == 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(out.get().chunk(0))
 *     else:
 */
  }

  /* "pyarrow/array.pxi":41
 *         return pyarrow_wrap_array(out.get().chunk(0))
 *     else:
 *         return pyarrow_wrap_chunked_array(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_out); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":19
 * 
 * 
 * cdef _sequence_to_array(object sequence, object mask, object size,             # <<<<<<<<<<<<<<
 *                         DataType type, CMemoryPool* pool, c_bool from_pandas):
 *     cdef int64_t c_size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._sequence_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":44
 * 
 * 
 * cdef inline _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, np.ndarray):
 *         return True
 */

static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_is_array_like", 0);

  /* "pyarrow/array.pxi":45
 * 
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":46
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):
 *         return True             # <<<<<<<<<<<<<<
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":45
 * 
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 */
  }

  /* "pyarrow/array.pxi":47
 *     if isinstance(obj, np.ndarray):
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_7pyarrow_3lib_pandas_api);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_array_like(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":44
 * 
 * 
 * cdef inline _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, np.ndarray):
 *         return True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_121_ndarray_to_arrow_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_120_ndarray_to_arrow_type[] = "_ndarray_to_arrow_type(values, DataType type)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_121_ndarray_to_arrow_type = {"_ndarray_to_arrow_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_121_ndarray_to_arrow_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_120_ndarray_to_arrow_type};
static PyObject *__pyx_pw_7pyarrow_3lib_121_ndarray_to_arrow_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ndarray_to_arrow_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_ndarray_to_arrow_type", 1, 2, 2, 1); __PYX_ERR(1, 50, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ndarray_to_arrow_type") < 0)) __PYX_ERR(1, 50, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = values[0];
    __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ndarray_to_arrow_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 50, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_arrow_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "type", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_120_ndarray_to_arrow_type(__pyx_self, __pyx_v_values, __pyx_v_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_120_ndarray_to_arrow_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::DataType>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_ndarray_to_arrow_type", 0);

  /* "pyarrow/array.pxi":51
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__ndarray_to_type(__pyx_v_values, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_t_1); 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;

  /* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_arrow_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":54
 * 
 * 
 * cdef shared_ptr[CDataType] _ndarray_to_type(object values,             # <<<<<<<<<<<<<<
 *                                             DataType type) except *:
 *     cdef shared_ptr[CDataType] c_type
 */

static std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib__ndarray_to_type(PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type) {
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  PyObject *__pyx_v_dtype = NULL;
  std::shared_ptr< arrow::DataType>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  std::shared_ptr< arrow::DataType>  __pyx_t_6;
  __Pyx_RefNannySetupContext("_ndarray_to_type", 0);

  /* "pyarrow/array.pxi":58
 *     cdef shared_ptr[CDataType] c_type
 * 
 *     dtype = values.dtype             # <<<<<<<<<<<<<<
 * 
 *     if type is None and dtype != object:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dtype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":60
 *     dtype = values.dtype
 * 
 *     if type is None and dtype != object:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_type) == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_dtype, __pyx_builtin_object, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":61
 * 
 *     if type is None and dtype != object:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":62
 *     if type is None and dtype != object:
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))             # <<<<<<<<<<<<<<
 * 
 *     if type is not None:
 */
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NumPyDtypeToArrow(__pyx_v_dtype, (&__pyx_v_c_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 62, __pyx_L7_error)
        }

        /* "pyarrow/array.pxi":61
 * 
 *     if type is None and dtype != object:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L8;
          }
          __pyx_L7_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L8:;
        }
    }

    /* "pyarrow/array.pxi":60
 *     dtype = values.dtype
 * 
 *     if type is None and dtype != object:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  }

  /* "pyarrow/array.pxi":64
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         c_type = type.sp_type
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_type) != Py_None);
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":65
 * 
 *     if type is not None:
 *         c_type = type.sp_type             # <<<<<<<<<<<<<<
 * 
 *     return c_type
 */
    __pyx_t_6 = __pyx_v_type->sp_type;
    __pyx_v_c_type = __pyx_t_6;

    /* "pyarrow/array.pxi":64
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         c_type = type.sp_type
 * 
 */
  }

  /* "pyarrow/array.pxi":67
 *         c_type = type.sp_type
 * 
 *     return c_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_c_type;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":54
 * 
 * 
 * cdef shared_ptr[CDataType] _ndarray_to_type(object values,             # <<<<<<<<<<<<<<
 *                                             DataType type) except *:
 *     cdef shared_ptr[CDataType] c_type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":70
 * 
 * 
 * cdef _ndarray_to_array(object values, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        c_bool from_pandas, c_bool safe, CMemoryPool* pool):
 *     cdef:
 */

static PyObject *__pyx_f_7pyarrow_3lib__ndarray_to_array(PyObject *__pyx_v_values, PyObject *__pyx_v_mask, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, bool __pyx_v_from_pandas, bool __pyx_v_safe,  arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_chunked_out;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
   arrow::compute::CastOptions __pyx_v_cast_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::DataType>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_ndarray_to_array", 0);

  /* "pyarrow/array.pxi":74
 *     cdef:
 *         shared_ptr[CChunkedArray] chunked_out
 *         shared_ptr[CDataType] c_type = _ndarray_to_type(values, type)             # <<<<<<<<<<<<<<
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__ndarray_to_type(__pyx_v_values, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 74, __pyx_L1_error)
  __pyx_v_c_type = __pyx_t_1;

  /* "pyarrow/array.pxi":75
 *         shared_ptr[CChunkedArray] chunked_out
 *         shared_ptr[CDataType] c_type = _ndarray_to_type(values, type)
 *         CCastOptions cast_options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_v_cast_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/array.pxi":77
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,
 *                                     c_type, cast_options, &chunked_out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":78
 * 
 *     with nogil:
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,             # <<<<<<<<<<<<<<
 *                                     c_type, cast_options, &chunked_out))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarrayToArrow(__pyx_v_pool, __pyx_v_values, __pyx_v_mask, __pyx_v_from_pandas, __pyx_v_c_type, __pyx_v_cast_options, (&__pyx_v_chunked_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 78, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":77
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,
 *                                     c_type, cast_options, &chunked_out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":81
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  __pyx_t_3 = ((__pyx_v_chunked_out.get()->num_chunks() > 1) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":82
 * 
 *     if chunked_out.get().num_chunks() > 1:
 *         return pyarrow_wrap_chunked_array(chunked_out)             # <<<<<<<<<<<<<<
 *     else:
 *         return pyarrow_wrap_array(chunked_out.get().chunk(0))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_chunked_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":81
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  }

  /* "pyarrow/array.pxi":84
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 *         return pyarrow_wrap_array(chunked_out.get().chunk(0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_chunked_out.get()->chunk(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":70
 * 
 * 
 * cdef _ndarray_to_array(object values, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        c_bool from_pandas, c_bool safe, CMemoryPool* pool):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":87
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_123_handle_arrow_array_protocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_122_handle_arrow_array_protocol[] = "_handle_arrow_array_protocol(obj, type, mask, size)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_123_handle_arrow_array_protocol = {"_handle_arrow_array_protocol", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_123_handle_arrow_array_protocol, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_122_handle_arrow_array_protocol};
static PyObject *__pyx_pw_7pyarrow_3lib_123_handle_arrow_array_protocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_handle_arrow_array_protocol (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_type,&__pyx_n_s_mask,&__pyx_n_s_size,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, 1); __PYX_ERR(1, 87, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, 2); __PYX_ERR(1, 87, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, 3); __PYX_ERR(1, 87, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_arrow_array_protocol") < 0)) __PYX_ERR(1, 87, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_obj = values[0];
    __pyx_v_type = values[1];
    __pyx_v_mask = values[2];
    __pyx_v_size = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 87, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._handle_arrow_array_protocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_122_handle_arrow_array_protocol(__pyx_self, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_122_handle_arrow_array_protocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __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;
  __Pyx_RefNannySetupContext("_handle_arrow_array_protocol", 0);

  /* "pyarrow/array.pxi":88
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Cannot specify a mask or a size when passing an object that is "
 */
  __pyx_t_2 = (__pyx_v_mask != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_size != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":89
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Cannot specify a mask or a size when passing an object that is "
 *             "converted with the __arrow_array__ protocol.")
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __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(1, 89, __pyx_L1_error)

    /* "pyarrow/array.pxi":88
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Cannot specify a mask or a size when passing an object that is "
 */
  }

  /* "pyarrow/array.pxi":92
 *             "Cannot specify a mask or a size when passing an object that is "
 *             "converted with the __arrow_array__ protocol.")
 *     res = obj.__arrow_array__(type=type)             # <<<<<<<<<<<<<<
 *     if not isinstance(res, Array):
 *         raise TypeError("The object's __arrow_array__ method does not "
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_arrow_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(1, 92, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_res = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":93
 *             "converted with the __arrow_array__ protocol.")
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, Array):             # <<<<<<<<<<<<<<
 *         raise TypeError("The object's __arrow_array__ method does not "
 *                         "return a pyarrow Array.")
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_res, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":94
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, Array):
 *         raise TypeError("The object's __arrow_array__ method does not "             # <<<<<<<<<<<<<<
 *                         "return a pyarrow Array.")
 *     return res
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__130, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 94, __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(1, 94, __pyx_L1_error)

    /* "pyarrow/array.pxi":93
 *             "converted with the __arrow_array__ protocol.")
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, Array):             # <<<<<<<<<<<<<<
 *         raise TypeError("The object's __arrow_array__ method does not "
 *                         "return a pyarrow Array.")
 */
  }

  /* "pyarrow/array.pxi":96
 *         raise TypeError("The object's __arrow_array__ method does not "
 *                         "return a pyarrow Array.")
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":87
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._handle_arrow_array_protocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":99
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_125array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_124array[] = "array(obj, type=None, mask=None, size=None, from_pandas=None, bool safe=True, MemoryPool memory_pool=None)\n\n    Create pyarrow.Array instance from a Python object\n\n    Parameters\n    ----------\n    obj : sequence, iterable, ndarray or Series\n        If both type and size are specified may be a single use iterable. If\n        not strongly-typed, Arrow type will be inferred for resulting array\n    type : pyarrow.DataType\n        Explicit type to attempt to coerce to, otherwise will be inferred from\n        the data\n    mask : array (boolean), optional\n        Indicate which values are null (True) or not null (False).\n    size : int64, optional\n        Size of the elements. If the imput is larger than size bail at this\n        length. For iterators, if size is larger than the input iterator this\n        will be treated as a \"max size\", but will involve an initial allocation\n        of size followed by a resize to the actual size (so if you know the\n        exact size specifying it correctly will give you better performance).\n    from_pandas : boolean, default None\n        Use pandas's semantics for inferring nulls from values in\n        ndarray-like data. If passed, the mask tasks precendence, but\n        if a value is unmasked (not-null), but still null according to\n        pandas semantics, then it is null. Defaults to False if not\n        passed explicitly by user, or True if a pandas object is\n        passed in\n    safe : boolean, default True\n        Check for overflows or other unsafe conversions\n    memory_pool : pyarrow.MemoryPool, optional\n        If not passed, will allocate memory from the currently-set default\n        memory pool\n\n    Notes\n    -----\n    Localized timestamps will currently be returned as UTC (pandas's native\n    representation).  Timezone-naive data will be implicitly interpreted as\n    UTC.\n\n    Examples\n    --------\n    >>> import pandas as pd\n    >>> import pyarrow as pa\n    >>> pa.array(pd.Se""ries([1, 2]))\n    <pyarrow.array.Int64Array object at 0x7f674e4c0e10>\n    [\n      1,\n      2\n    ]\n\n    >>> import numpy as np\n    >>> pa.array(pd.Series([1, 2]), np.array([0, 1],\n    ... dtype=bool))\n    <pyarrow.array.Int64Array object at 0x7f9019e11208>\n    [\n      1,\n      null\n    ]\n\n    Returns\n    -------\n    array : pyarrow.Array or pyarrow.ChunkedArray (if object data\n    overflowed binary storage)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_125array = {"array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_125array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_124array};
static PyObject *__pyx_pw_7pyarrow_3lib_125array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_from_pandas = 0;
  int __pyx_v_safe;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_type,&__pyx_n_s_mask,&__pyx_n_s_size,&__pyx_n_s_from_pandas,&__pyx_n_s_safe,&__pyx_n_s_memory_pool,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":100
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,
 *           bint safe=True, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create pyarrow.Array instance from a Python object
 */
    values[6] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_pandas);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array") < 0)) __PYX_ERR(1, 99, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_type = values[1];
    __pyx_v_mask = values[2];
    __pyx_v_size = values[3];
    __pyx_v_from_pandas = values[4];
    if (values[5]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[6]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("array", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 99, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 100, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_124array(__pyx_self, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size, __pyx_v_from_pandas, __pyx_v_safe, __pyx_v_memory_pool);

  /* "pyarrow/array.pxi":99
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_124array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, PyObject *__pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_v_pool;
  int __pyx_v_is_pandas_object;
  int __pyx_v_c_from_pandas;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  __Pyx_RefNannySetupContext("array", 0);
  __Pyx_INCREF(__pyx_v_type);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":165
 *     """
 *     cdef:
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *         bint is_pandas_object = False
 *         bint c_from_pandas
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":166
 *     cdef:
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         bint is_pandas_object = False             # <<<<<<<<<<<<<<
 *         bint c_from_pandas
 * 
 */
  __pyx_v_is_pandas_object = 0;

  /* "pyarrow/array.pxi":169
 *         bint c_from_pandas
 * 
 *     type = ensure_type(type, allow_none=True)             # <<<<<<<<<<<<<<
 * 
 *     if from_pandas is None:
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 1;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":171
 *     type = ensure_type(type, allow_none=True)
 * 
 *     if from_pandas is None:             # <<<<<<<<<<<<<<
 *         c_from_pandas = False
 *     else:
 */
  __pyx_t_3 = (__pyx_v_from_pandas == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":172
 * 
 *     if from_pandas is None:
 *         c_from_pandas = False             # <<<<<<<<<<<<<<
 *     else:
 *         c_from_pandas = from_pandas
 */
    __pyx_v_c_from_pandas = 0;

    /* "pyarrow/array.pxi":171
 *     type = ensure_type(type, allow_none=True)
 * 
 *     if from_pandas is None:             # <<<<<<<<<<<<<<
 *         c_from_pandas = False
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":174
 *         c_from_pandas = False
 *     else:
 *         c_from_pandas = from_pandas             # <<<<<<<<<<<<<<
 * 
 *     if hasattr(obj, '__arrow_array__'):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_from_pandas); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 174, __pyx_L1_error)
    __pyx_v_c_from_pandas = __pyx_t_4;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":176
 *         c_from_pandas = from_pandas
 * 
 *     if hasattr(obj, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_arrow_array); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 176, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":177
 * 
 *     if hasattr(obj, '__arrow_array__'):
 *         return _handle_arrow_array_protocol(obj, type, mask, size)             # <<<<<<<<<<<<<<
 *     elif _is_array_like(obj):
 *         if mask is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_handle_arrow_array_protocol); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 177, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 177, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
      __Pyx_INCREF(__pyx_v_type);
      __Pyx_GIVEREF(__pyx_v_type);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_type);
      __Pyx_INCREF(__pyx_v_mask);
      __Pyx_GIVEREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_mask);
      __Pyx_INCREF(__pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_size);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":176
 *         c_from_pandas = from_pandas
 * 
 *     if hasattr(obj, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 */
  }

  /* "pyarrow/array.pxi":178
 *     if hasattr(obj, '__arrow_array__'):
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):             # <<<<<<<<<<<<<<
 *         if mask is not None:
 *             # out argument unused
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__is_array_like(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":179
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 *         if mask is not None:             # <<<<<<<<<<<<<<
 *             # out argument unused
 *             mask = get_series_values(mask, &is_pandas_object)
 */
    __pyx_t_3 = (__pyx_v_mask != Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (__pyx_t_4) {

      /* "pyarrow/array.pxi":181
 *         if mask is not None:
 *             # out argument unused
 *             mask = get_series_values(mask, &is_pandas_object)             # <<<<<<<<<<<<<<
 * 
 *         values = get_series_values(obj, &is_pandas_object)
 */
      __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_series_values(__pyx_v_mask, (&__pyx_v_is_pandas_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/array.pxi":179
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 *         if mask is not None:             # <<<<<<<<<<<<<<
 *             # out argument unused
 *             mask = get_series_values(mask, &is_pandas_object)
 */
    }

    /* "pyarrow/array.pxi":183
 *             mask = get_series_values(mask, &is_pandas_object)
 * 
 *         values = get_series_values(obj, &is_pandas_object)             # <<<<<<<<<<<<<<
 *         if is_pandas_object and from_pandas is None:
 *             c_from_pandas = True
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_series_values(__pyx_v_obj, (&__pyx_v_is_pandas_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_values = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":184
 * 
 *         values = get_series_values(obj, &is_pandas_object)
 *         if is_pandas_object and from_pandas is None:             # <<<<<<<<<<<<<<
 *             c_from_pandas = True
 * 
 */
    __pyx_t_3 = (__pyx_v_is_pandas_object != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_4 = __pyx_t_3;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_from_pandas == Py_None);
    __pyx_t_9 = (__pyx_t_3 != 0);
    __pyx_t_4 = __pyx_t_9;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_4) {

      /* "pyarrow/array.pxi":185
 *         values = get_series_values(obj, &is_pandas_object)
 *         if is_pandas_object and from_pandas is None:
 *             c_from_pandas = True             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(values, np.ma.MaskedArray):
 */
      __pyx_v_c_from_pandas = 1;

      /* "pyarrow/array.pxi":184
 * 
 *         values = get_series_values(obj, &is_pandas_object)
 *         if is_pandas_object and from_pandas is None:             # <<<<<<<<<<<<<<
 *             c_from_pandas = True
 * 
 */
    }

    /* "pyarrow/array.pxi":187
 *             c_from_pandas = True
 * 
 *         if isinstance(values, np.ma.MaskedArray):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ma); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MaskedArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = PyObject_IsInstance(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 187, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (__pyx_t_4 != 0);
    if (__pyx_t_9) {

      /* "pyarrow/array.pxi":188
 * 
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Cannot pass a numpy masked array and "
 *                                  "specify a mask at the same time")
 */
      __pyx_t_9 = (__pyx_v_mask != Py_None);
      __pyx_t_4 = (__pyx_t_9 != 0);
      if (unlikely(__pyx_t_4)) {

        /* "pyarrow/array.pxi":189
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "             # <<<<<<<<<<<<<<
 *                                  "specify a mask at the same time")
 *             else:
 */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__131, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(1, 189, __pyx_L1_error)

        /* "pyarrow/array.pxi":188
 * 
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Cannot pass a numpy masked array and "
 *                                  "specify a mask at the same time")
 */
      }

      /* "pyarrow/array.pxi":192
 *                                  "specify a mask at the same time")
 *             else:
 *                 mask = values.mask             # <<<<<<<<<<<<<<
 *                 values = values.data
 * 
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "pyarrow/array.pxi":193
 *             else:
 *                 mask = values.mask
 *                 values = values.data             # <<<<<<<<<<<<<<
 * 
 *         if hasattr(values, '__arrow_array__'):
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "pyarrow/array.pxi":187
 *             c_from_pandas = True
 * 
 *         if isinstance(values, np.ma.MaskedArray):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "
 */
    }

    /* "pyarrow/array.pxi":195
 *                 values = values.data
 * 
 *         if hasattr(values, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 */
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_values, __pyx_n_u_arrow_array); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 195, __pyx_L1_error)
    __pyx_t_9 = (__pyx_t_4 != 0);
    if (__pyx_t_9) {

      /* "pyarrow/array.pxi":196
 * 
 *         if hasattr(values, '__arrow_array__'):
 *             return _handle_arrow_array_protocol(values, type, mask, size)             # <<<<<<<<<<<<<<
 *         elif pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_handle_arrow_array_protocol); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_values, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_values, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_values);
        __Pyx_GIVEREF(__pyx_v_values);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_values);
        __Pyx_INCREF(__pyx_v_type);
        __Pyx_GIVEREF(__pyx_v_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_type);
        __Pyx_INCREF(__pyx_v_mask);
        __Pyx_GIVEREF(__pyx_v_mask);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_mask);
        __Pyx_INCREF(__pyx_v_size);
        __Pyx_GIVEREF(__pyx_v_size);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_size);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pyarrow/array.pxi":195
 *                 values = values.data
 * 
 *         if hasattr(values, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 */
    }

    /* "pyarrow/array.pxi":197
 *         if hasattr(values, '__arrow_array__'):
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):             # <<<<<<<<<<<<<<
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_categorical(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_values, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 197, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pyarrow/array.pxi":198
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/array.pxi":199
 *         elif pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,             # <<<<<<<<<<<<<<
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_codes); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_categories); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/array.pxi":198
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
      __pyx_t_5 = 0;
      __pyx_t_8 = 0;

      /* "pyarrow/array.pxi":200
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,             # <<<<<<<<<<<<<<
 *                 from_pandas=True, safe=safe,
 *                 memory_pool=memory_pool)
 */
      __pyx_t_8 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 200, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_ordered); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_ordered, __pyx_t_5) < 0) __PYX_ERR(1, 200, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":201
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,             # <<<<<<<<<<<<<<
 *                 memory_pool=memory_pool)
 *         else:
 */
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_from_pandas, Py_True) < 0) __PYX_ERR(1, 200, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_safe, __pyx_t_5) < 0) __PYX_ERR(1, 200, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":202
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,
 *                 memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *         else:
 *             if pandas_api.have_pandas:
 */
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 200, __pyx_L1_error)

      /* "pyarrow/array.pxi":198
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "pyarrow/array.pxi":197
 *         if hasattr(values, '__arrow_array__'):
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):             # <<<<<<<<<<<<<<
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 */
    }

    /* "pyarrow/array.pxi":204
 *                 memory_pool=memory_pool)
 *         else:
 *             if pandas_api.have_pandas:             # <<<<<<<<<<<<<<
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_have_pandas); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 204, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_9) {

        /* "pyarrow/array.pxi":205
 *         else:
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(             # <<<<<<<<<<<<<<
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_compat); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_get_datetimetz_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pyarrow/array.pxi":206
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)             # <<<<<<<<<<<<<<
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 *                                      pool)
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_8, __pyx_v_type};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 205, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_8, __pyx_v_type};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 205, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 205, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_1) {
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          }
          __Pyx_INCREF(__pyx_v_values);
          __Pyx_GIVEREF(__pyx_v_values);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_v_values);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_8);
          __Pyx_INCREF(__pyx_v_type);
          __Pyx_GIVEREF(__pyx_v_type);
          PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_7, __pyx_v_type);
          __pyx_t_8 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 205, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
          PyObject* sequence = __pyx_t_5;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 205, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_10);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 205, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 205, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 205, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L13_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(1, 205, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L14_unpacking_done;
          __pyx_L13_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 205, __pyx_L1_error)
          __pyx_L14_unpacking_done:;
        }

        /* "pyarrow/array.pxi":205
 *         else:
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(             # <<<<<<<<<<<<<<
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 */
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "pyarrow/array.pxi":204
 *                 memory_pool=memory_pool)
 *         else:
 *             if pandas_api.have_pandas:             # <<<<<<<<<<<<<<
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 */
      }

      /* "pyarrow/array.pxi":207
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,             # <<<<<<<<<<<<<<
 *                                      pool)
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      if (!(likely(((__pyx_v_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 207, __pyx_L1_error)

      /* "pyarrow/array.pxi":208
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 *                                      pool)             # <<<<<<<<<<<<<<
 *     else:
 *         # ConvertPySequence does strict conversion if type is explicitly passed
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib__ndarray_to_array(__pyx_v_values, __pyx_v_mask, ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_type), __pyx_v_c_from_pandas, __pyx_v_safe, __pyx_v_pool); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "pyarrow/array.pxi":178
 *     if hasattr(obj, '__arrow_array__'):
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):             # <<<<<<<<<<<<<<
 *         if mask is not None:
 *             # out argument unused
 */
  }

  /* "pyarrow/array.pxi":211
 *     else:
 *         # ConvertPySequence does strict conversion if type is explicitly passed
 *         return _sequence_to_array(obj, mask, size, type, pool, c_from_pandas)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 211, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7pyarrow_3lib__sequence_to_array(__pyx_v_obj, __pyx_v_mask, __pyx_v_size, ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_type), __pyx_v_pool, __pyx_v_c_from_pandas); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":99
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_type);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":214
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_127asarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_126asarray[] = "asarray(values, type=None)\n\n    Convert to pyarrow.Array, inferring type if not provided. Attempt to cast\n    if indicated type is different\n\n    Parameters\n    ----------\n    values : array-like\n        This can be a sequence, numpy.ndarray, pyarrow.Array or\n        pyarrow.ChunkedArray. If a ChunkedArray is passed, the output will be\n        a ChunkedArray, otherwise the output will be a Array.\n    type : string or DataType\n\n    Returns\n    -------\n    arr : Array or ChunkedArray\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_127asarray = {"asarray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_127asarray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_126asarray};
static PyObject *__pyx_pw_7pyarrow_3lib_127asarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asarray (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asarray") < 0)) __PYX_ERR(1, 214, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = values[0];
    __pyx_v_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("asarray", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 214, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.asarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_126asarray(__pyx_self, __pyx_v_values, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_126asarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __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;
  __Pyx_RefNannySetupContext("asarray", 0);
  __Pyx_INCREF(__pyx_v_values);

  /* "pyarrow/array.pxi":231
 *     arr : Array or ChunkedArray
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_values, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_values, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":232
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):
 *         if type is not None and not values.type.equals(type):             # <<<<<<<<<<<<<<
 *             values = values.cast(type)
 * 
 */
    __pyx_t_1 = (__pyx_v_type != Py_None);
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_equals); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_type);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = ((!__pyx_t_3) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":233
 *     if isinstance(values, (Array, ChunkedArray)):
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_cast); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_type);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/array.pxi":232
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):
 *         if type is not None and not values.type.equals(type):             # <<<<<<<<<<<<<<
 *             values = values.cast(type)
 * 
 */
    }

    /* "pyarrow/array.pxi":235
 *             values = values.cast(type)
 * 
 *         return values             # <<<<<<<<<<<<<<
 *     else:
 *         return array(values, type=type)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_values);
    __pyx_r = __pyx_v_values;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":231
 *     arr : Array or ChunkedArray
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)
 */
  }

  /* "pyarrow/array.pxi":237
 *         return values
 *     else:
 *         return array(values, type=type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_values);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(1, 237, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":214
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.asarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":240
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_129infer_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_128infer_type[] = "infer_type(values, mask=None, from_pandas=False)\n\n    Attempt to infer Arrow data type that can hold the passed Python\n    sequence type in an Array object\n\n    Parameters\n    ----------\n    values : array-like\n        Sequence to infer type from\n    mask : ndarray (bool type), optional\n        Optional exclusion mask where True marks null, False non-null\n    from_pandas : boolean, default False\n        Use pandas's NA/null sentinel values for type inference\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_129infer_type = {"infer_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_129infer_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_128infer_type};
static PyObject *__pyx_pw_7pyarrow_3lib_129infer_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_from_pandas = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("infer_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_from_pandas,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_pandas);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "infer_type") < 0)) __PYX_ERR(1, 240, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = values[0];
    __pyx_v_mask = values[1];
    __pyx_v_from_pandas = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("infer_type", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 240, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.infer_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_128infer_type(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_from_pandas);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_128infer_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_mask, PyObject *__pyx_v_from_pandas) {
  std::shared_ptr< arrow::DataType>  __pyx_v_out;
  bool __pyx_v_use_pandas_sentinels;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  int __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 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("infer_type", 0);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":260
 *     cdef:
 *         shared_ptr[CDataType] out
 *         c_bool use_pandas_sentinels = from_pandas             # <<<<<<<<<<<<<<
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_from_pandas); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 260, __pyx_L1_error)
  __pyx_v_use_pandas_sentinels = __pyx_t_1;

  /* "pyarrow/array.pxi":262
 *         c_bool use_pandas_sentinels = from_pandas
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):             # <<<<<<<<<<<<<<
 *         mask = np.array(mask, dtype=bool)
 * 
 */
  __pyx_t_3 = (__pyx_v_mask != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_mask, __pyx_t_6); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":263
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):
 *         mask = np.array(mask, dtype=bool)             # <<<<<<<<<<<<<<
 * 
 *     check_status(InferArrowType(values, mask, use_pandas_sentinels, &out))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_mask);
    __Pyx_GIVEREF(__pyx_v_mask);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_mask);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(1, 263, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __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_SET(__pyx_v_mask, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyarrow/array.pxi":262
 *         c_bool use_pandas_sentinels = from_pandas
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):             # <<<<<<<<<<<<<<
 *         mask = np.array(mask, dtype=bool)
 * 
 */
  }

  /* "pyarrow/array.pxi":265
 *         mask = np.array(mask, dtype=bool)
 * 
 *     check_status(InferArrowType(values, mask, use_pandas_sentinels, &out))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(out)
 * 
 */
  __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::InferArrowType(__pyx_v_values, __pyx_v_mask, __pyx_v_use_pandas_sentinels, (&__pyx_v_out))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 265, __pyx_L1_error)

  /* "pyarrow/array.pxi":266
 * 
 *     check_status(InferArrowType(values, mask, use_pandas_sentinels, &out))
 *     return pyarrow_wrap_data_type(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_out); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":240
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.infer_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":269
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_131_normalize_slice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_130_normalize_slice[] = "_normalize_slice(arrow_obj, slice key)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_131_normalize_slice = {"_normalize_slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_131_normalize_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_130_normalize_slice};
static PyObject *__pyx_pw_7pyarrow_3lib_131_normalize_slice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrow_obj = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_normalize_slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrow_obj,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrow_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_normalize_slice", 1, 2, 2, 1); __PYX_ERR(1, 269, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_normalize_slice") < 0)) __PYX_ERR(1, 269, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arrow_obj = values[0];
    __pyx_v_key = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_normalize_slice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 269, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._normalize_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PySlice_Type), 1, "key", 1))) __PYX_ERR(1, 269, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_130_normalize_slice(__pyx_self, __pyx_v_arrow_obj, __pyx_v_key);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_130_normalize_slice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrow_obj, PyObject *__pyx_v_key) {
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("_normalize_slice", 0);

  /* "pyarrow/array.pxi":272
 *     cdef:
 *         Py_ssize_t start, stop, step
 *         Py_ssize_t n = len(arrow_obj)             # <<<<<<<<<<<<<<
 * 
 *     start = key.start or 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrow_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 272, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "pyarrow/array.pxi":274
 *         Py_ssize_t n = len(arrow_obj)
 * 
 *     start = key.start or 0             # <<<<<<<<<<<<<<
 *     if start < 0:
 *         start += n
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PySliceObject*)__pyx_v_key)->start); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 274, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_key)->start); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 274, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_start = __pyx_t_1;

  /* "pyarrow/array.pxi":275
 * 
 *     start = key.start or 0
 *     if start < 0:             # <<<<<<<<<<<<<<
 *         start += n
 *         if start < 0:
 */
  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":276
 *     start = key.start or 0
 *     if start < 0:
 *         start += n             # <<<<<<<<<<<<<<
 *         if start < 0:
 *             start = 0
 */
    __pyx_v_start = (__pyx_v_start + __pyx_v_n);

    /* "pyarrow/array.pxi":277
 *     if start < 0:
 *         start += n
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start = 0
 *     elif start >= n:
 */
    __pyx_t_2 = ((__pyx_v_start < 0) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":278
 *         start += n
 *         if start < 0:
 *             start = 0             # <<<<<<<<<<<<<<
 *     elif start >= n:
 *         start = n
 */
      __pyx_v_start = 0;

      /* "pyarrow/array.pxi":277
 *     if start < 0:
 *         start += n
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start = 0
 *     elif start >= n:
 */
    }

    /* "pyarrow/array.pxi":275
 * 
 *     start = key.start or 0
 *     if start < 0:             # <<<<<<<<<<<<<<
 *         start += n
 *         if start < 0:
 */
    goto __pyx_L5;
  }

  /* "pyarrow/array.pxi":279
 *         if start < 0:
 *             start = 0
 *     elif start >= n:             # <<<<<<<<<<<<<<
 *         start = n
 * 
 */
  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_n) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":280
 *             start = 0
 *     elif start >= n:
 *         start = n             # <<<<<<<<<<<<<<
 * 
 *     stop = key.stop if key.stop is not None else n
 */
    __pyx_v_start = __pyx_v_n;

    /* "pyarrow/array.pxi":279
 *         if start < 0:
 *             start = 0
 *     elif start >= n:             # <<<<<<<<<<<<<<
 *         start = n
 * 
 */
  }
  __pyx_L5:;

  /* "pyarrow/array.pxi":282
 *         start = n
 * 
 *     stop = key.stop if key.stop is not None else n             # <<<<<<<<<<<<<<
 *     if stop < 0:
 *         stop += n
 */
  __pyx_t_2 = (((PySliceObject*)__pyx_v_key)->stop != Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_key)->stop); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 282, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_v_n;
  }
  __pyx_v_stop = __pyx_t_1;

  /* "pyarrow/array.pxi":283
 * 
 *     stop = key.stop if key.stop is not None else n
 *     if stop < 0:             # <<<<<<<<<<<<<<
 *         stop += n
 *         if stop < 0:
 */
  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":284
 *     stop = key.stop if key.stop is not None else n
 *     if stop < 0:
 *         stop += n             # <<<<<<<<<<<<<<
 *         if stop < 0:
 *             stop = 0
 */
    __pyx_v_stop = (__pyx_v_stop + __pyx_v_n);

    /* "pyarrow/array.pxi":285
 *     if stop < 0:
 *         stop += n
 *         if stop < 0:             # <<<<<<<<<<<<<<
 *             stop = 0
 *     elif stop >= n:
 */
    __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":286
 *         stop += n
 *         if stop < 0:
 *             stop = 0             # <<<<<<<<<<<<<<
 *     elif stop >= n:
 *         stop = n
 */
      __pyx_v_stop = 0;

      /* "pyarrow/array.pxi":285
 *     if stop < 0:
 *         stop += n
 *         if stop < 0:             # <<<<<<<<<<<<<<
 *             stop = 0
 *     elif stop >= n:
 */
    }

    /* "pyarrow/array.pxi":283
 * 
 *     stop = key.stop if key.stop is not None else n
 *     if stop < 0:             # <<<<<<<<<<<<<<
 *         stop += n
 *         if stop < 0:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/array.pxi":287
 *         if stop < 0:
 *             stop = 0
 *     elif stop >= n:             # <<<<<<<<<<<<<<
 *         stop = n
 * 
 */
  __pyx_t_2 = ((__pyx_v_stop >= __pyx_v_n) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":288
 *             stop = 0
 *     elif stop >= n:
 *         stop = n             # <<<<<<<<<<<<<<
 * 
 *     step = key.step or 1
 */
    __pyx_v_stop = __pyx_v_n;

    /* "pyarrow/array.pxi":287
 *         if stop < 0:
 *             stop = 0
 *     elif stop >= n:             # <<<<<<<<<<<<<<
 *         stop = n
 * 
 */
  }
  __pyx_L7:;

  /* "pyarrow/array.pxi":290
 *         stop = n
 * 
 *     step = key.step or 1             # <<<<<<<<<<<<<<
 *     if step != 1:
 *         raise IndexError('only slices with step 1 supported')
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PySliceObject*)__pyx_v_key)->step); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 290, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_key)->step); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 290, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = 1;
  __pyx_L9_bool_binop_done:;
  __pyx_v_step = __pyx_t_1;

  /* "pyarrow/array.pxi":291
 * 
 *     step = key.step or 1
 *     if step != 1:             # <<<<<<<<<<<<<<
 *         raise IndexError('only slices with step 1 supported')
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_step != 1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":292
 *     step = key.step or 1
 *     if step != 1:
 *         raise IndexError('only slices with step 1 supported')             # <<<<<<<<<<<<<<
 *     else:
 *         return arrow_obj.slice(start, stop - start)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __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(1, 292, __pyx_L1_error)

    /* "pyarrow/array.pxi":291
 * 
 *     step = key.step or 1
 *     if step != 1:             # <<<<<<<<<<<<<<
 *         raise IndexError('only slices with step 1 supported')
 *     else:
 */
  }

  /* "pyarrow/array.pxi":294
 *         raise IndexError('only slices with step 1 supported')
 *     else:
 *         return arrow_obj.slice(start, stop - start)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_obj, __pyx_n_s_slice); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyInt_FromSsize_t((__pyx_v_stop - __pyx_v_start)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 294, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 294, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":269
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */

  /* 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_10);
  __Pyx_AddTraceback("pyarrow.lib._normalize_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":297
 * 
 * 
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:
 */

static Py_ssize_t __pyx_f_7pyarrow_3lib__normalize_index(Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_normalize_index", 0);

  /* "pyarrow/array.pxi":299
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += length
 *         if index < 0:
 */
  __pyx_t_1 = ((__pyx_v_index < 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":300
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:
 *         index += length             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError("index out of bounds")
 */
    __pyx_v_index = (__pyx_v_index + __pyx_v_length);

    /* "pyarrow/array.pxi":301
 *     if index < 0:
 *         index += length
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 */
    __pyx_t_1 = ((__pyx_v_index < 0) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/array.pxi":302
 *         index += length
 *         if index < 0:
 *             raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 302, __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(1, 302, __pyx_L1_error)

      /* "pyarrow/array.pxi":301
 *     if index < 0:
 *         index += length
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 */
    }

    /* "pyarrow/array.pxi":299
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += length
 *         if index < 0:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":303
 *         if index < 0:
 *             raise IndexError("index out of bounds")
 *     elif index >= length:             # <<<<<<<<<<<<<<
 *         raise IndexError("index out of bounds")
 *     return index
 */
  __pyx_t_1 = ((__pyx_v_index >= __pyx_v_length) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":304
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 *         raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     return index
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __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(1, 304, __pyx_L1_error)

    /* "pyarrow/array.pxi":303
 *         if index < 0:
 *             raise IndexError("index out of bounds")
 *     elif index >= length:             # <<<<<<<<<<<<<<
 *         raise IndexError("index out of bounds")
 *     return index
 */
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":305
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 *     return index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_index;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":297
 * 
 * 
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._normalize_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":312
 *         unique_ptr[CFunctionContext] ctx
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_16_FunctionContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_16_FunctionContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16_FunctionContext___cinit__(((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_16_FunctionContext___cinit__(struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/array.pxi":313
 * 
 *     def __cinit__(self):
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))             # <<<<<<<<<<<<<<
 * 
 * cdef _FunctionContext _global_ctx = _FunctionContext()
 */
  __pyx_v_self->ctx.reset(new  arrow::compute::FunctionContext( arrow::default_memory_pool()));

  /* "pyarrow/array.pxi":312
 *         unique_ptr[CFunctionContext] ctx
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__[] = "_FunctionContext.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._FunctionContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__[] = "_FunctionContext.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._FunctionContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":317
 * cdef _FunctionContext _global_ctx = _FunctionContext()
 * 
 * cdef CFunctionContext* _context() nogil:             # <<<<<<<<<<<<<<
 *     return _global_ctx.ctx.get()
 * 
 */

static  arrow::compute::FunctionContext *__pyx_f_7pyarrow_3lib__context(void) {
   arrow::compute::FunctionContext *__pyx_r;

  /* "pyarrow/array.pxi":318
 * 
 * cdef CFunctionContext* _context() nogil:
 *     return _global_ctx.ctx.get()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_7pyarrow_3lib__global_ctx->ctx.get();
  goto __pyx_L0;

  /* "pyarrow/array.pxi":317
 * cdef _FunctionContext _global_ctx = _FunctionContext()
 * 
 * cdef CFunctionContext* _context() nogil:             # <<<<<<<<<<<<<<
 *     return _global_ctx.ctx.get()
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/array.pxi":321
 * 
 * 
 * cdef wrap_datum(const CDatum& datum):             # <<<<<<<<<<<<<<
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 */

static PyObject *__pyx_f_7pyarrow_3lib_wrap_datum( arrow::compute::Datum const &__pyx_v_datum) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("wrap_datum", 0);

  /* "pyarrow/array.pxi":322
 * 
 * cdef wrap_datum(const CDatum& datum):
 *     if datum.kind() == DatumType_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::ARRAY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":323
 * cdef wrap_datum(const CDatum& datum):
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))             # <<<<<<<<<<<<<<
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(arrow::MakeArray(__pyx_v_datum.array())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":322
 * 
 * cdef wrap_datum(const CDatum& datum):
 *     if datum.kind() == DatumType_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 */
  }

  /* "pyarrow/array.pxi":324
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::CHUNKED_ARRAY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":325
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())             # <<<<<<<<<<<<<<
 *     elif datum.kind() == DatumType_SCALAR:
 *         return pyarrow_wrap_scalar(datum.scalar())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_datum.chunked_array()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":324
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:
 */
  }

  /* "pyarrow/array.pxi":326
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::SCALAR) != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":327
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:
 *         return pyarrow_wrap_scalar(datum.scalar())             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(__pyx_v_datum.scalar()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":326
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 */
  }

  /* "pyarrow/array.pxi":329
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __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(1, 329, __pyx_L1_error)
  }

  /* "pyarrow/array.pxi":321
 * 
 * 
 * cdef wrap_datum(const CDatum& datum):             # <<<<<<<<<<<<<<
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.wrap_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":332
 * 
 * 
 * cdef _append_array_buffers(const CArrayData* ad, list res):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively append Buffer wrappers from *ad* and its children.
 */

static PyObject *__pyx_f_7pyarrow_3lib__append_array_buffers( arrow::ArrayData const *__pyx_v_ad, PyObject *__pyx_v_res) {
  size_t __pyx_v_i;
  size_t __pyx_v_n;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("_append_array_buffers", 0);

  /* "pyarrow/array.pxi":337
 *     """
 *     cdef size_t i, n
 *     assert ad != NULL             # <<<<<<<<<<<<<<
 *     n = ad.buffers.size()
 *     for i in range(n):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_ad != NULL) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 337, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":338
 *     cdef size_t i, n
 *     assert ad != NULL
 *     n = ad.buffers.size()             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         buf = ad.buffers[i]
 */
  __pyx_v_n = __pyx_v_ad->buffers.size();

  /* "pyarrow/array.pxi":339
 *     assert ad != NULL
 *     n = ad.buffers.size()
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pyarrow/array.pxi":340
 *     n = ad.buffers.size()
 *     for i in range(n):
 *         buf = ad.buffers[i]             # <<<<<<<<<<<<<<
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)
 */
    __pyx_v_buf = (__pyx_v_ad->buffers[__pyx_v_i]);

    /* "pyarrow/array.pxi":341
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
    if (unlikely(__pyx_v_res == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
      __PYX_ERR(1, 341, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":342
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 *     n = ad.child_data.size()
 *     for i in range(n):
 */
    if (((__pyx_v_buf.get() != NULL) != 0)) {

      /* "pyarrow/array.pxi":341
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":342
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 *     n = ad.child_data.size()
 *     for i in range(n):
 */
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }

    /* "pyarrow/array.pxi":341
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":343
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         _append_array_buffers(ad.child_data[i].get(), res)
 */
  __pyx_v_n = __pyx_v_ad->child_data.size();

  /* "pyarrow/array.pxi":344
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         _append_array_buffers(ad.child_data[i].get(), res)
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pyarrow/array.pxi":345
 *     n = ad.child_data.size()
 *     for i in range(n):
 *         _append_array_buffers(ad.child_data[i].get(), res)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_7pyarrow_3lib__append_array_buffers((__pyx_v_ad->child_data[__pyx_v_i]).get(), __pyx_v_res); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":332
 * 
 * 
 * cdef _append_array_buffers(const CArrayData* ad, list res):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively append Buffer wrappers from *ad* and its children.
 */

  /* 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_AddTraceback("pyarrow.lib._append_array_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":348
 * 
 * 
 * cdef _reduce_array_data(const CArrayData* ad):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively dissect ArrayData to (pickable) tuples.
 */

static PyObject *__pyx_f_7pyarrow_3lib__reduce_array_data( arrow::ArrayData const *__pyx_v_ad) {
  size_t __pyx_v_i;
  size_t __pyx_v_n;
  PyObject *__pyx_v_buffers = NULL;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_v_children = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_reduce_array_data", 0);

  /* "pyarrow/array.pxi":353
 *     """
 *     cdef size_t i, n
 *     assert ad != NULL             # <<<<<<<<<<<<<<
 * 
 *     n = ad.buffers.size()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_ad != NULL) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 353, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":355
 *     assert ad != NULL
 * 
 *     n = ad.buffers.size()             # <<<<<<<<<<<<<<
 *     buffers = []
 *     for i in range(n):
 */
  __pyx_v_n = __pyx_v_ad->buffers.size();

  /* "pyarrow/array.pxi":356
 * 
 *     n = ad.buffers.size()
 *     buffers = []             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         buf = ad.buffers[i]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":357
 *     n = ad.buffers.size()
 *     buffers = []
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)
 */
  __pyx_t_2 = __pyx_v_n;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/array.pxi":358
 *     buffers = []
 *     for i in range(n):
 *         buf = ad.buffers[i]             # <<<<<<<<<<<<<<
 *         buffers.append(pyarrow_wrap_buffer(buf)
 *                        if buf.get() != NULL else None)
 */
    __pyx_v_buf = (__pyx_v_ad->buffers[__pyx_v_i]);

    /* "pyarrow/array.pxi":360
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)
 *                        if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 * 
 *     children = []
 */
    if (((__pyx_v_buf.get() != NULL) != 0)) {

      /* "pyarrow/array.pxi":359
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                        if buf.get() != NULL else None)
 * 
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":360
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)
 *                        if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 * 
 *     children = []
 */
      __Pyx_INCREF(Py_None);
      __pyx_t_1 = Py_None;
    }

    /* "pyarrow/array.pxi":359
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                        if buf.get() != NULL else None)
 * 
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_buffers, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":362
 *                        if buf.get() != NULL else None)
 * 
 *     children = []             # <<<<<<<<<<<<<<
 *     n = ad.child_data.size()
 *     for i in range(n):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":363
 * 
 *     children = []
 *     n = ad.child_data.size()             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 */
  __pyx_v_n = __pyx_v_ad->child_data.size();

  /* "pyarrow/array.pxi":364
 *     children = []
 *     n = ad.child_data.size()
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 */
  __pyx_t_2 = __pyx_v_n;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/array.pxi":365
 *     n = ad.child_data.size()
 *     for i in range(n):
 *         children.append(_reduce_array_data(ad.child_data[i].get()))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib__reduce_array_data((__pyx_v_ad->child_data[__pyx_v_i]).get()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_children, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 365, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":367
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \             # <<<<<<<<<<<<<<
 *         ad.offset, buffers, children
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_ad->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->null_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/array.pxi":368
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \
 *         ad.offset, buffers, children             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->offset); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/array.pxi":367
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \             # <<<<<<<<<<<<<<
 *         ad.offset, buffers, children
 * 
 */
  __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_buffers);
  __Pyx_GIVEREF(__pyx_v_buffers);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_buffers);
  __Pyx_INCREF(__pyx_v_children);
  __Pyx_GIVEREF(__pyx_v_children);
  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_v_children);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":348
 * 
 * 
 * cdef _reduce_array_data(const CArrayData* ad):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively dissect ArrayData to (pickable) tuples.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib._reduce_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffers);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":371
 * 
 * 
 * cdef shared_ptr[CArrayData] _reconstruct_array_data(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct CArrayData objects from the tuple structure generated
 */

static std::shared_ptr< arrow::ArrayData>  __pyx_f_7pyarrow_3lib__reconstruct_array_data(PyObject *__pyx_v_data) {
  int64_t __pyx_v_length;
  int64_t __pyx_v_null_count;
  int64_t __pyx_v_offset;
  int64_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_dtype = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  std::vector<std::shared_ptr< arrow::Buffer> >  __pyx_v_c_buffers;
  std::vector<std::shared_ptr< arrow::ArrayData> >  __pyx_v_c_children;
  PyObject *__pyx_v_buffers = NULL;
  PyObject *__pyx_v_children = NULL;
  std::shared_ptr< arrow::ArrayData>  __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)(PyObject *);
  int64_t __pyx_t_9;
  int64_t __pyx_t_10;
  int64_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("_reconstruct_array_data", 0);

  /* "pyarrow/array.pxi":383
 *         vector[shared_ptr[CArrayData]] c_children
 * 
 *     dtype, length, null_count, offset, buffers, children = data             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(buffers)):
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_data))) || (PyList_CheckExact(__pyx_v_data))) {
    PyObject* sequence = __pyx_v_data;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 6)) {
      if (size > 6) __Pyx_RaiseTooManyValuesError(6);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(1, 383, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 5); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
      for (i=0; i < 6; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 383, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
    __pyx_t_7 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    for (index=0; index < 6; index++) {
      PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 6) < 0) __PYX_ERR(1, 383, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(1, 383, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 383, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_dtype = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_length = __pyx_t_9;
  __pyx_v_null_count = __pyx_t_10;
  __pyx_v_offset = __pyx_t_11;
  __pyx_v_buffers = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_children = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":385
 *     dtype, length, null_count, offset, buffers, children = data
 * 
 *     for i in range(len(buffers)):             # <<<<<<<<<<<<<<
 *         buf = buffers[i]
 *         if buf is None:
 */
  __pyx_t_12 = PyObject_Length(__pyx_v_buffers); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 385, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pyarrow/array.pxi":386
 * 
 *     for i in range(len(buffers)):
 *         buf = buffers[i]             # <<<<<<<<<<<<<<
 *         if buf is None:
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_buffers, __pyx_v_i, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(1, 386, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":387
 *     for i in range(len(buffers)):
 *         buf = buffers[i]
 *         if buf is None:             # <<<<<<<<<<<<<<
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 */
    __pyx_t_14 = (((PyObject *)__pyx_v_buf) == Py_None);
    __pyx_t_15 = (__pyx_t_14 != 0);
    if (__pyx_t_15) {

      /* "pyarrow/array.pxi":388
 *         buf = buffers[i]
 *         if buf is None:
 *             c_buffers.push_back(shared_ptr[CBuffer]())             # <<<<<<<<<<<<<<
 *         else:
 *             c_buffers.push_back(buf.buffer)
 */
      try {
        __pyx_v_c_buffers.push_back(std::shared_ptr< arrow::Buffer> ());
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 388, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":387
 *     for i in range(len(buffers)):
 *         buf = buffers[i]
 *         if buf is None:             # <<<<<<<<<<<<<<
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 */
      goto __pyx_L7;
    }

    /* "pyarrow/array.pxi":390
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 *             c_buffers.push_back(buf.buffer)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(children)):
 */
    /*else*/ {
      try {
        __pyx_v_c_buffers.push_back(__pyx_v_buf->buffer);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 390, __pyx_L1_error)
      }
    }
    __pyx_L7:;
  }

  /* "pyarrow/array.pxi":392
 *             c_buffers.push_back(buf.buffer)
 * 
 *     for i in range(len(children)):             # <<<<<<<<<<<<<<
 *         c_children.push_back(_reconstruct_array_data(children[i]))
 * 
 */
  __pyx_t_12 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 392, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pyarrow/array.pxi":393
 * 
 *     for i in range(len(children)):
 *         c_children.push_back(_reconstruct_array_data(children[i]))             # <<<<<<<<<<<<<<
 * 
 *     return CArrayData.MakeWithChildren(
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_children, __pyx_v_i, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    try {
      __pyx_v_c_children.push_back(__pyx_f_7pyarrow_3lib__reconstruct_array_data(__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 393, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pyarrow/array.pxi":395
 *         c_children.push_back(_reconstruct_array_data(children[i]))
 * 
 *     return CArrayData.MakeWithChildren(             # <<<<<<<<<<<<<<
 *         dtype.sp_type,
 *         length,
 */
  __pyx_r =  arrow::ArrayData:: Make(__pyx_v_dtype->sp_type, __pyx_v_length, __pyx_v_c_buffers, __pyx_v_c_children, __pyx_v_null_count, __pyx_v_offset);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":371
 * 
 * 
 * cdef shared_ptr[CArrayData] _reconstruct_array_data(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct CArrayData objects from the tuple structure generated
 */

  /* 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_WriteUnraisable("pyarrow.lib._reconstruct_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_buffers);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":404
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_133_restore_array(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_132_restore_array[] = "_restore_array(data)\n\n    Reconstruct an Array from pickled ArrayData.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_133_restore_array = {"_restore_array", (PyCFunction)__pyx_pw_7pyarrow_3lib_133_restore_array, METH_O, __pyx_doc_7pyarrow_3lib_132_restore_array};
static PyObject *__pyx_pw_7pyarrow_3lib_133_restore_array(PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_restore_array (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_132_restore_array(__pyx_self, ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_132_restore_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
  std::shared_ptr< arrow::ArrayData>  __pyx_v_ad;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_restore_array", 0);

  /* "pyarrow/array.pxi":408
 *     Reconstruct an Array from pickled ArrayData.
 *     """
 *     cdef shared_ptr[CArrayData] ad = _reconstruct_array_data(data)             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_array(MakeArray(ad))
 * 
 */
  __pyx_v_ad = __pyx_f_7pyarrow_3lib__reconstruct_array_data(__pyx_v_data);

  /* "pyarrow/array.pxi":409
 *     """
 *     cdef shared_ptr[CArrayData] ad = _reconstruct_array_data(data)
 *     return pyarrow_wrap_array(MakeArray(ad))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(arrow::MakeArray(__pyx_v_ad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":404
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._restore_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":414
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(             # <<<<<<<<<<<<<<
 *             self,
 *             memory_pool=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_to_pandas[] = "_PandasConvertible.to_pandas(self, memory_pool=None, categories=None, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=True, bool use_threads=True, bool deduplicate_objects=True, bool ignore_metadata=False)\n\n        Convert to a pandas-compatible NumPy array or DataFrame, as appropriate\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            Arrow MemoryPool to use for allocations. Uses the default memory\n            pool is not passed\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\n        categories: list, default empty\n            List of fields that should be returned as pandas.Categorical. Only\n            applies to table-like data structures\n        zero_copy_only : boolean, default False\n            Raise an ArrowException if this function call would require copying\n            the underlying data\n        integer_object_nulls : boolean, default False\n            Cast integers with nulls to objects\n        date_as_object : boolean, default False\n            Cast dates to objects\n        use_threads: boolean, default True\n            Whether to parallelize the conversion using multiple threads\n        deduplicate_objects : boolean, default False\n            Do not create multiple copies Python objects when created, to save\n            on memory use. Conversion will be slower\n        ignore_metadata : boolean, default False\n            If True, do not use the 'pandas' metadata to reconstruct the\n            DataFrame index, if present\n\n        Returns\n        -------\n        pandas.Series or pandas.DataFrame depending on type of object\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_v_categories = 0;
  int __pyx_v_strings_to_categorical;
  int __pyx_v_zero_copy_only;
  int __pyx_v_integer_object_nulls;
  int __pyx_v_date_as_object;
  int __pyx_v_use_threads;
  int __pyx_v_deduplicate_objects;
  int __pyx_v_ignore_metadata;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,&__pyx_n_s_categories,&__pyx_n_s_strings_to_categorical,&__pyx_n_s_zero_copy_only,&__pyx_n_s_integer_object_nulls,&__pyx_n_s_date_as_object,&__pyx_n_s_use_threads,&__pyx_n_s_deduplicate_objects,&__pyx_n_s_ignore_metadata,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};

    /* "pyarrow/array.pxi":416
 *     def to_pandas(
 *             self,
 *             memory_pool=None,             # <<<<<<<<<<<<<<
 *             categories=None,
 *             bint strings_to_categorical=False,
 */
    values[0] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":417
 *             self,
 *             memory_pool=None,
 *             categories=None,             # <<<<<<<<<<<<<<
 *             bint strings_to_categorical=False,
 *             bint zero_copy_only=False,
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strings_to_categorical);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zero_copy_only);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_integer_object_nulls);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_date_as_object);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_threads);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deduplicate_objects);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_metadata);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_pandas") < 0)) __PYX_ERR(1, 414, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = values[0];
    __pyx_v_categories = values[1];
    if (values[2]) {
      __pyx_v_strings_to_categorical = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_strings_to_categorical == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 418, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":418
 *             memory_pool=None,
 *             categories=None,
 *             bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *             bint zero_copy_only=False,
 *             bint integer_object_nulls=False,
 */
      __pyx_v_strings_to_categorical = ((int)0);
    }
    if (values[3]) {
      __pyx_v_zero_copy_only = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_zero_copy_only == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 419, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":419
 *             categories=None,
 *             bint strings_to_categorical=False,
 *             bint zero_copy_only=False,             # <<<<<<<<<<<<<<
 *             bint integer_object_nulls=False,
 *             bint date_as_object=True,
 */
      __pyx_v_zero_copy_only = ((int)0);
    }
    if (values[4]) {
      __pyx_v_integer_object_nulls = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_integer_object_nulls == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 420, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":420
 *             bint strings_to_categorical=False,
 *             bint zero_copy_only=False,
 *             bint integer_object_nulls=False,             # <<<<<<<<<<<<<<
 *             bint date_as_object=True,
 *             bint use_threads=True,
 */
      __pyx_v_integer_object_nulls = ((int)0);
    }
    if (values[5]) {
      __pyx_v_date_as_object = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_date_as_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 421, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":421
 *             bint zero_copy_only=False,
 *             bint integer_object_nulls=False,
 *             bint date_as_object=True,             # <<<<<<<<<<<<<<
 *             bint use_threads=True,
 *             bint deduplicate_objects=True,
 */
      __pyx_v_date_as_object = ((int)1);
    }
    if (values[6]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 422, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":422
 *             bint integer_object_nulls=False,
 *             bint date_as_object=True,
 *             bint use_threads=True,             # <<<<<<<<<<<<<<
 *             bint deduplicate_objects=True,
 *             bint ignore_metadata=False
 */
      __pyx_v_use_threads = ((int)1);
    }
    if (values[7]) {
      __pyx_v_deduplicate_objects = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_deduplicate_objects == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 423, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":423
 *             bint date_as_object=True,
 *             bint use_threads=True,
 *             bint deduplicate_objects=True,             # <<<<<<<<<<<<<<
 *             bint ignore_metadata=False
 *     ):
 */
      __pyx_v_deduplicate_objects = ((int)1);
    }
    if (values[8]) {
      __pyx_v_ignore_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_ignore_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 424, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":424
 *             bint use_threads=True,
 *             bint deduplicate_objects=True,
 *             bint ignore_metadata=False             # <<<<<<<<<<<<<<
 *     ):
 *         """
 */
      __pyx_v_ignore_metadata = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 414, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self), __pyx_v_memory_pool, __pyx_v_categories, __pyx_v_strings_to_categorical, __pyx_v_zero_copy_only, __pyx_v_integer_object_nulls, __pyx_v_date_as_object, __pyx_v_use_threads, __pyx_v_deduplicate_objects, __pyx_v_ignore_metadata);

  /* "pyarrow/array.pxi":414
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(             # <<<<<<<<<<<<<<
 *             self,
 *             memory_pool=None,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v_memory_pool, PyObject *__pyx_v_categories, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object, int __pyx_v_use_threads, int __pyx_v_deduplicate_objects, int __pyx_v_ignore_metadata) {
  PyObject *__pyx_v_options = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_pandas", 0);

  /* "pyarrow/array.pxi":460
 *         """
 *         options = dict(
 *             pool=memory_pool,             # <<<<<<<<<<<<<<
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(1, 460, __pyx_L1_error)

  /* "pyarrow/array.pxi":461
 *         options = dict(
 *             pool=memory_pool,
 *             strings_to_categorical=strings_to_categorical,             # <<<<<<<<<<<<<<
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_strings_to_categorical); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_strings_to_categorical, __pyx_t_2) < 0) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":462
 *             pool=memory_pool,
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,             # <<<<<<<<<<<<<<
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_zero_copy_only); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_zero_copy_only, __pyx_t_2) < 0) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":463
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,             # <<<<<<<<<<<<<<
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_integer_object_nulls); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_integer_object_nulls, __pyx_t_2) < 0) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":464
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,             # <<<<<<<<<<<<<<
 *             use_threads=use_threads,
 *             deduplicate_objects=deduplicate_objects
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_date_as_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_date_as_object, __pyx_t_2) < 0) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":465
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             deduplicate_objects=deduplicate_objects
 *         )
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_use_threads, __pyx_t_2) < 0) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":466
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,
 *             deduplicate_objects=deduplicate_objects             # <<<<<<<<<<<<<<
 *         )
 *         return self._to_pandas(options, categories=categories,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_deduplicate_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deduplicate_objects, __pyx_t_2) < 0) __PYX_ERR(1, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_options = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":468
 *             deduplicate_objects=deduplicate_objects
 *         )
 *         return self._to_pandas(options, categories=categories,             # <<<<<<<<<<<<<<
 *                                ignore_metadata=ignore_metadata)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_categories, __pyx_v_categories) < 0) __PYX_ERR(1, 468, __pyx_L1_error)

  /* "pyarrow/array.pxi":469
 *         )
 *         return self._to_pandas(options, categories=categories,
 *                                ignore_metadata=ignore_metadata)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_ignore_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ignore_metadata, __pyx_t_4) < 0) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":468
 *             deduplicate_objects=deduplicate_objects
 *         )
 *         return self._to_pandas(options, categories=categories,             # <<<<<<<<<<<<<<
 *                                ignore_metadata=ignore_metadata)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":414
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(             # <<<<<<<<<<<<<<
 *             self,
 *             memory_pool=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.lib._PandasConvertible.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_options);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__[] = "_PandasConvertible.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__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;
  __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:
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_state = __pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 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:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__PandasConvertibl); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_222419149);
    __Pyx_GIVEREF(__pyx_int_222419149);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __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__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__PandasConvertibl); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_222419149);
    __Pyx_GIVEREF(__pyx_int_222419149);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __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.lib._PandasConvertible.__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__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__[] = "_PandasConvertible.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":472
 * 
 * 
 * cdef PandasOptions _convert_pandas_options(dict options):             # <<<<<<<<<<<<<<
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 */

static arrow::py::PandasOptions __pyx_f_7pyarrow_3lib__convert_pandas_options(PyObject *__pyx_v_options) {
  arrow::py::PandasOptions __pyx_v_result;
  arrow::py::PandasOptions __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  bool __pyx_t_2;
  __Pyx_RefNannySetupContext("_convert_pandas_options", 0);

  /* "pyarrow/array.pxi":474
 * cdef PandasOptions _convert_pandas_options(dict options):
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])             # <<<<<<<<<<<<<<
 *     result.strings_to_categorical = options['strings_to_categorical']
 *     result.zero_copy_only = options['zero_copy_only']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 474, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(1, 474, __pyx_L1_error)
  __pyx_v_result.pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":475
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 *     result.strings_to_categorical = options['strings_to_categorical']             # <<<<<<<<<<<<<<
 *     result.zero_copy_only = options['zero_copy_only']
 *     result.integer_object_nulls = options['integer_object_nulls']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 475, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_strings_to_categorical); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.strings_to_categorical = __pyx_t_2;

  /* "pyarrow/array.pxi":476
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 *     result.strings_to_categorical = options['strings_to_categorical']
 *     result.zero_copy_only = options['zero_copy_only']             # <<<<<<<<<<<<<<
 *     result.integer_object_nulls = options['integer_object_nulls']
 *     result.date_as_object = options['date_as_object']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 476, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_zero_copy_only); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.zero_copy_only = __pyx_t_2;

  /* "pyarrow/array.pxi":477
 *     result.strings_to_categorical = options['strings_to_categorical']
 *     result.zero_copy_only = options['zero_copy_only']
 *     result.integer_object_nulls = options['integer_object_nulls']             # <<<<<<<<<<<<<<
 *     result.date_as_object = options['date_as_object']
 *     result.use_threads = options['use_threads']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 477, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_integer_object_nulls); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.integer_object_nulls = __pyx_t_2;

  /* "pyarrow/array.pxi":478
 *     result.zero_copy_only = options['zero_copy_only']
 *     result.integer_object_nulls = options['integer_object_nulls']
 *     result.date_as_object = options['date_as_object']             # <<<<<<<<<<<<<<
 *     result.use_threads = options['use_threads']
 *     result.deduplicate_objects = options['deduplicate_objects']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 478, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_date_as_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.date_as_object = __pyx_t_2;

  /* "pyarrow/array.pxi":479
 *     result.integer_object_nulls = options['integer_object_nulls']
 *     result.date_as_object = options['date_as_object']
 *     result.use_threads = options['use_threads']             # <<<<<<<<<<<<<<
 *     result.deduplicate_objects = options['deduplicate_objects']
 *     return result
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 479, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_use_threads); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.use_threads = __pyx_t_2;

  /* "pyarrow/array.pxi":480
 *     result.date_as_object = options['date_as_object']
 *     result.use_threads = options['use_threads']
 *     result.deduplicate_objects = options['deduplicate_objects']             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 480, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_deduplicate_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 480, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.deduplicate_objects = __pyx_t_2;

  /* "pyarrow/array.pxi":481
 *     result.use_threads = options['use_threads']
 *     result.deduplicate_objects = options['deduplicate_objects']
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":472
 * 
 * 
 * cdef PandasOptions _convert_pandas_options(dict options):             # <<<<<<<<<<<<<<
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib._convert_pandas_options", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":489
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use one of "
 *                         "the `pyarrow.Array.from_*` functions instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Array_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Array_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array___init__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Array___init__(struct __pyx_obj_7pyarrow_3lib_Array *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/array.pxi":492
 *         raise TypeError("Do not call {}'s constructor directly, use one of "
 *                         "the `pyarrow.Array.from_*` functions instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_7, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":490
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `pyarrow.Array.from_*` functions instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(1, 490, __pyx_L1_error)

  /* "pyarrow/array.pxi":489
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use one of "
 *                         "the `pyarrow.Array.from_*` functions instead."
 */

  /* 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.lib.Array.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":494
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_5Array_init(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/array.pxi":495
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = sp_array.get()
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 */
  __pyx_v_self->sp_array = __pyx_v_sp_array;

  /* "pyarrow/array.pxi":496
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 * 
 */
  __pyx_v_self->ap = __pyx_v_sp_array.get();

  /* "pyarrow/array.pxi":497
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->sp_array.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 497, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":494
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/array.pxi":499
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '
 *                                   'implemented')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_2__eq__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_2__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/array.pxi":500
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 500, __pyx_L1_error)

  /* "pyarrow/array.pxi":499
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '
 *                                   'implemented')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":503
 *                                   'implemented')
 * 
 *     def _debug_print(self):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(DebugPrint(deref(self.ap), 0))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_4_debug_print[] = "Array._debug_print(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_debug_print (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_4_debug_print(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4_debug_print(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_debug_print", 0);

  /* "pyarrow/array.pxi":504
 * 
 *     def _debug_print(self):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":505
 *     def _debug_print(self):
 *         with nogil:
 *             check_status(DebugPrint(deref(self.ap), 0))             # <<<<<<<<<<<<<<
 * 
 *     def diff(self, Array other):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::DebugPrint((*__pyx_v_self->ap), 0)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 505, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":504
 * 
 *     def _debug_print(self):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":503
 *                                   'implemented')
 * 
 *     def _debug_print(self):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(DebugPrint(deref(self.ap), 0))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array._debug_print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":507
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 *     def diff(self, Array other):             # <<<<<<<<<<<<<<
 *         """
 *         Return string containing the result of arrow::Diff comparing contents
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_7diff(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_6diff[] = "Array.diff(self, Array other)\n\n        Return string containing the result of arrow::Diff comparing contents\n        of this array against the other array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_7diff(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Array, 1, "other", 0))) __PYX_ERR(1, 507, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_6diff(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6diff(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other) {
  std::string __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("diff", 0);

  /* "pyarrow/array.pxi":513
 *         """
 *         cdef c_string result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.ap.Diff(deref(other.ap))
 *         return frombytes(result)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":514
 *         cdef c_string result
 *         with nogil:
 *             result = self.ap.Diff(deref(other.ap))             # <<<<<<<<<<<<<<
 *         return frombytes(result)
 * 
 */
        __pyx_v_result = __pyx_v_self->ap->Diff((*__pyx_v_other->ap));
      }

      /* "pyarrow/array.pxi":513
 *         """
 *         cdef c_string result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.ap.Diff(deref(other.ap))
 *         return frombytes(result)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":515
 *         with nogil:
 *             result = self.ap.Diff(deref(other.ap))
 *         return frombytes(result)             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, object target_type, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(1, 515, __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/array.pxi":507
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 *     def diff(self, Array other):             # <<<<<<<<<<<<<<
 *         """
 *         Return string containing the result of arrow::Diff comparing contents
 */

  /* 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.lib.Array.diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":517
 *         return frombytes(result)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast array values to another data type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_8cast[] = "Array.cast(self, target_type, bool safe=True)\n\n        Cast array values to another data type.\n\n        Example\n        -------\n\n        >>> from datetime import datetime\n        >>> import pyarrow as pa\n        >>> arr = pa.array([datetime(2010, 1, 1), datetime(2015, 1, 1)])\n        >>> arr.type\n        TimestampType(timestamp[us])\n\n        You can use ``pyarrow.DataType`` objects to specify the target type:\n\n        >>> arr.cast(pa.timestamp('ms'))\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast(pa.timestamp('ms')).type\n        TimestampType(timestamp[ms])\n\n        Alternatively, it is also supported to use the string aliases for these\n        types:\n\n        >>> arr.cast('timestamp[ms]')\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast('timestamp[ms]').type\n        TimestampType(timestamp[ms])\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to cast to\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target_type = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target_type,&__pyx_n_s_safe,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast") < 0)) __PYX_ERR(1, 517, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target_type = values[0];
    if (values[1]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 517, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 517, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_8cast(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_target_type, __pyx_v_safe);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_8cast(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe) {
   arrow::compute::CastOptions __pyx_v_options;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("cast", 0);

  /* "pyarrow/array.pxi":565
 *         """
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 *             DataType type = ensure_type(target_type)
 *             shared_ptr[CArray] result
 */
  __pyx_v_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/array.pxi":566
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)
 *             DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] result
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":569
 *             shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), self.ap[0], type.sp_type,
 *                               options, &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":570
 * 
 *         with nogil:
 *             check_status(Cast(_context(), self.ap[0], type.sp_type,             # <<<<<<<<<<<<<<
 *                               options, &result))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Cast(__pyx_f_7pyarrow_3lib__context(), (__pyx_v_self->ap[0]), __pyx_v_type->sp_type, __pyx_v_options, (&__pyx_v_result))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 570, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":569
 *             shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), self.ap[0], type.sp_type,
 *                               options, &result))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":573
 *                               options, &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def view(self, object target_type):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":517
 *         return frombytes(result)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast array values to another data type.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":575
 *         return pyarrow_wrap_array(result)
 * 
 *     def view(self, object target_type):             # <<<<<<<<<<<<<<
 *         """Return zero-copy "view" of array as another data type. The data
 *         types must have compatible columnar buffer layouts
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11view(PyObject *__pyx_v_self, PyObject *__pyx_v_target_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_10view[] = "Array.view(self, target_type)\nReturn zero-copy \"view\" of array as another data type. The data\n        types must have compatible columnar buffer layouts\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to construct view as\n\n        Returns\n        -------\n        view : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11view(PyObject *__pyx_v_self, PyObject *__pyx_v_target_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("view (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_10view(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_target_type));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10view(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("view", 0);

  /* "pyarrow/array.pxi":588
 *         view : Array
 *         """
 *         cdef DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CArray] result
 *         with nogil:
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":590
 *         cdef DataType type = ensure_type(target_type)
 *         cdef shared_ptr[CArray] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.ap.View(type.sp_type, &result))
 *         return pyarrow_wrap_array(result)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":591
 *         cdef shared_ptr[CArray] result
 *         with nogil:
 *             check_status(self.ap.View(type.sp_type, &result))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(result)
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->ap->View(__pyx_v_type->sp_type, (&__pyx_v_result))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 591, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":590
 *         cdef DataType type = ensure_type(target_type)
 *         cdef shared_ptr[CArray] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.ap.View(type.sp_type, &result))
 *         return pyarrow_wrap_array(result)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":592
 *         with nogil:
 *             check_status(self.ap.View(type.sp_type, &result))
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def sum(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":575
 *         return pyarrow_wrap_array(result)
 * 
 *     def view(self, object target_type):             # <<<<<<<<<<<<<<
 *         """Return zero-copy "view" of array as another data type. The data
 *         types must have compatible columnar buffer layouts
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":594
 *         return pyarrow_wrap_array(result)
 * 
 *     def sum(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sum the values in a numerical array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_13sum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_12sum[] = "Array.sum(self)\n\n        Sum the values in a numerical array.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_13sum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sum (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_12sum(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_12sum(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("sum", 0);

  /* "pyarrow/array.pxi":600
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":601
 * 
 *         with nogil:
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))             # <<<<<<<<<<<<<<
 * 
 *         return wrap_datum(out)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Sum(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 601, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":600
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":603
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def unique(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":594
 *         return pyarrow_wrap_array(result)
 * 
 *     def sum(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sum the values in a numerical array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":605
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_15unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_14unique[] = "Array.unique(self)\n\n        Compute distinct elements in array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_15unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unique (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_14unique(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_14unique(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("unique", 0);

  /* "pyarrow/array.pxi":611
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":612
 * 
 *         with nogil:
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(result)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Unique(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 612, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":611
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":614
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":605
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":616
 *         return pyarrow_wrap_array(result)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_17dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_16dictionary_encode[] = "Array.dictionary_encode(self)\n\n        Compute dictionary-encoded representation of array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_17dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_16dictionary_encode(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_16dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("dictionary_encode", 0);

  /* "pyarrow/array.pxi":622
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DictionaryEncode(_context(), CDatum(self.sp_array),
 *                                           &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":623
 * 
 *         with nogil:
 *             check_status(DictionaryEncode(_context(), CDatum(self.sp_array),             # <<<<<<<<<<<<<<
 *                                           &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::DictionaryEncode(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 623, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":622
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DictionaryEncode(_context(), CDatum(self.sp_array),
 *                                           &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":626
 *                                           &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":616
 *         return pyarrow_wrap_array(result)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.dictionary_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":629
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_19from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_18from_pandas[] = "Array.from_pandas(obj, mask=None, type=None, bool safe=True, MemoryPool memory_pool=None)\n\n        Convert pandas.Series to an Arrow Array, using pandas's semantics about\n        what values indicate nulls. See pyarrow.array for more general\n        conversion from arrays or sequences to Arrow arrays.\n\n        Parameters\n        ----------\n        sequence : ndarray, Inded Series\n        mask : array (boolean), optional\n            Indicate which values are null (True) or not null (False)\n        type : pyarrow.DataType\n            Explicit type to attempt to coerce to, otherwise will be inferred\n            from the data\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n        memory_pool : pyarrow.MemoryPool, optional\n            If not passed, will allocate memory from the currently-set default\n            memory pool\n\n        Notes\n        -----\n        Localized timestamps will currently be returned as UTC (pandas's native\n        representation).  Timezone-naive data will be implicitly interpreted as\n        UTC.\n\n        Returns\n        -------\n        array : pyarrow.Array or pyarrow.ChunkedArray (if object data\n        overflows binary buffer)\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Array_19from_pandas = {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_19from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_18from_pandas};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_19from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_type = 0;
  int __pyx_v_safe;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_mask,&__pyx_n_s_type,&__pyx_n_s_safe,&__pyx_n_s_memory_pool,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":630
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,
 *                     MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.Series to an Arrow Array, using pandas's semantics about
 */
    values[4] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(1, 629, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_mask = values[1];
    __pyx_v_type = values[2];
    if (values[3]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 629, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":629
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 629, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 630, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_18from_pandas(__pyx_v_obj, __pyx_v_mask, __pyx_v_type, __pyx_v_safe, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_18from_pandas(PyObject *__pyx_v_obj, PyObject *__pyx_v_mask, PyObject *__pyx_v_type, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "pyarrow/array.pxi":661
 *         overflows binary buffer)
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,             # <<<<<<<<<<<<<<
 *                      memory_pool=memory_pool)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 661, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(1, 661, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_t_4) < 0) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_from_pandas, Py_True) < 0) __PYX_ERR(1, 661, __pyx_L1_error)

  /* "pyarrow/array.pxi":662
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,
 *                      memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 661, __pyx_L1_error)

  /* "pyarrow/array.pxi":661
 *         overflows binary buffer)
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,             # <<<<<<<<<<<<<<
 *                      memory_pool=memory_pool)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":629
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=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.lib.Array.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":664
 *                      memory_pool=memory_pool)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _restore_array, \
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_20__reduce__[] = "Array.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_20__reduce__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_20__reduce__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/array.pxi":665
 * 
 *     def __reduce__(self):
 *         return _restore_array, \             # <<<<<<<<<<<<<<
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_restore_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/array.pxi":666
 *     def __reduce__(self):
 *         return _restore_array, \
 *             (_reduce_array_data(self.sp_array.get().data().get()),)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__reduce_array_data(__pyx_v_self->sp_array.get()->data().get()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":665
 * 
 *     def __reduce__(self):
 *         return _restore_array, \             # <<<<<<<<<<<<<<
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":664
 *                      memory_pool=memory_pool)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _restore_array, \
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Array.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":669
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_23from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_22from_buffers[] = "Array.from_buffers(DataType type, length, buffers, null_count=-1, offset=0, children=None)\n\n        Construct an Array from a sequence of buffers. The concrete type\n        returned depends on the datatype.\n\n        Parameters\n        ----------\n        type : DataType\n            The value type of the array\n        length : int\n            The number of values in the array\n        buffers: List[Buffer]\n            The buffers backing this array\n        null_count : int, default -1\n        offset : int, default 0\n            The array's logical offset (in values, not in bytes) from the\n            start of each buffer\n        children : List[Array], default None\n            Nested type children with length matching type.num_children\n\n        Returns\n        -------\n        array : Array\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Array_23from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_23from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_22from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_23from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_buffers = 0;
  PyObject *__pyx_v_null_count = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_children = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_buffers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_length,&__pyx_n_s_buffers,&__pyx_n_s_null_count,&__pyx_n_s_offset,&__pyx_n_s_children,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_int_neg_1);
    values[4] = ((PyObject *)__pyx_int_0);

    /* "pyarrow/array.pxi":670
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,
 *                      children=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct an Array from a sequence of buffers. The concrete type
 */
    values[5] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 1); __PYX_ERR(1, 669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 2); __PYX_ERR(1, 669, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_count);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(1, 669, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
    __pyx_v_length = values[1];
    __pyx_v_buffers = values[2];
    __pyx_v_null_count = values[3];
    __pyx_v_offset = values[4];
    __pyx_v_children = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 669, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "type", 0))) __PYX_ERR(1, 669, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_22from_buffers(__pyx_v_type, __pyx_v_length, __pyx_v_buffers, __pyx_v_null_count, __pyx_v_offset, __pyx_v_children);

  /* "pyarrow/array.pxi":669
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_22from_buffers(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, PyObject *__pyx_v_length, PyObject *__pyx_v_buffers, PyObject *__pyx_v_null_count, PyObject *__pyx_v_offset, PyObject *__pyx_v_children) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_child = 0;
  std::vector<std::shared_ptr< arrow::Buffer> >  __pyx_v_c_buffers;
  std::vector<std::shared_ptr< arrow::ArrayData> >  __pyx_v_c_child_data;
  std::shared_ptr< arrow::ArrayData>  __pyx_v_array_data;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int64_t __pyx_t_11;
  int64_t __pyx_t_12;
  int64_t __pyx_t_13;
  __Pyx_RefNannySetupContext("from_buffers", 0);
  __Pyx_INCREF(__pyx_v_children);

  /* "pyarrow/array.pxi":701
 *             shared_ptr[CArrayData] array_data
 * 
 *         children = children or []             # <<<<<<<<<<<<<<
 * 
 *         if type.num_children != len(children):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 701, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_children);
    __pyx_t_1 = __pyx_v_children;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_children, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":703
 *         children = children or []
 * 
 *         if type.num_children != len(children):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of children "
 *                              "({0}) did not match the passed number "
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 703, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":706
 *             raise ValueError("Type's expected number of children "
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_children, len(children)))             # <<<<<<<<<<<<<<
 * 
 *         if type.num_buffers != len(buffers):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_s_expected_number_of_childr, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 706, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":704
 * 
 *         if type.num_children != len(children):
 *             raise ValueError("Type's expected number of children "             # <<<<<<<<<<<<<<
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_children, len(children)))
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 704, __pyx_L1_error)

    /* "pyarrow/array.pxi":703
 *         children = children or []
 * 
 *         if type.num_children != len(children):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of children "
 *                              "({0}) did not match the passed number "
 */
  }

  /* "pyarrow/array.pxi":708
 *                              "({1}).".format(type.num_children, len(children)))
 * 
 *         if type.num_buffers != len(buffers):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of buffers "
 *                              "({0}) did not match the passed number "
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_buffers); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Length(__pyx_v_buffers); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 708, __pyx_L1_error)
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":711
 *             raise ValueError("Type's expected number of buffers "
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_buffers, len(buffers)))             # <<<<<<<<<<<<<<
 * 
 *         for buf in buffers:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_s_expected_number_of_buffer, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_buffers); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Length(__pyx_v_buffers); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 711, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_6};
      __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 711, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_6};
      __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 711, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 711, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_3 = 0;
      __pyx_t_6 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 711, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/array.pxi":709
 * 
 *         if type.num_buffers != len(buffers):
 *             raise ValueError("Type's expected number of buffers "             # <<<<<<<<<<<<<<
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_buffers, len(buffers)))
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(1, 709, __pyx_L1_error)

    /* "pyarrow/array.pxi":708
 *                              "({1}).".format(type.num_children, len(children)))
 * 
 *         if type.num_buffers != len(buffers):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of buffers "
 *                              "({0}) did not match the passed number "
 */
  }

  /* "pyarrow/array.pxi":713
 *                              "({1}).".format(type.num_buffers, len(buffers)))
 * 
 *         for buf in buffers:             # <<<<<<<<<<<<<<
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 */
  if (likely(PyList_CheckExact(__pyx_v_buffers)) || PyTuple_CheckExact(__pyx_v_buffers)) {
    __pyx_t_5 = __pyx_v_buffers; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_buffers); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 713, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 713, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 713, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 713, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 713, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 713, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(1, 713, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "pyarrow/array.pxi":715
 *         for buf in buffers:
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))             # <<<<<<<<<<<<<<
 * 
 *         for child in children:
 */
    try {
      __pyx_v_c_buffers.push_back(__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(((PyObject *)__pyx_v_buf)));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 715, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":713
 *                              "({1}).".format(type.num_buffers, len(buffers)))
 * 
 *         for buf in buffers:             # <<<<<<<<<<<<<<
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":717
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 * 
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c_child_data.push_back(child.ap.data())
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_children)) || PyTuple_CheckExact(__pyx_v_children)) {
    __pyx_t_5 = __pyx_v_children; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 717, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 717, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 717, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 717, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 717, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 717, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 717, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "pyarrow/array.pxi":718
 * 
 *         for child in children:
 *             c_child_data.push_back(child.ap.data())             # <<<<<<<<<<<<<<
 * 
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,
 */
    try {
      __pyx_v_c_child_data.push_back(__pyx_v_child->ap->data());
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 718, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":717
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 * 
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c_child_data.push_back(child.ap.data())
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":720
 *             c_child_data.push_back(child.ap.data())
 * 
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,             # <<<<<<<<<<<<<<
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)
 */
  __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 720, __pyx_L1_error)

  /* "pyarrow/array.pxi":722
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))
 *         result.validate()
 */
  __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_null_count); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 722, __pyx_L1_error)
  __pyx_t_13 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_13 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 722, __pyx_L1_error)

  /* "pyarrow/array.pxi":720
 *             c_child_data.push_back(child.ap.data())
 * 
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,             # <<<<<<<<<<<<<<
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)
 */
  __pyx_v_array_data =  arrow::ArrayData:: Make(__pyx_v_type->sp_type, __pyx_t_11, __pyx_v_c_buffers, __pyx_v_c_child_data, __pyx_t_12, __pyx_t_13);

  /* "pyarrow/array.pxi":723
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(arrow::MakeArray(__pyx_v_array_data)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 723, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":724
 *                                                  null_count, offset)
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":725
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":669
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.Array.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":728
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.sp_array.get().null_count()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_10null_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_10null_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_10null_count___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":729
 *     @property
 *     def null_count(self):
 *         return self.sp_array.get().null_count()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->sp_array.get()->null_count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":728
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.sp_array.get().null_count()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.null_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_5Array_26generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/array.pxi":731
 *         return self.sp_array.get().null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_25__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_25__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_24__iter__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_24__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 731, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_5Array_26generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Array___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(1, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_5Array_26generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 731, __pyx_L1_error)

  /* "pyarrow/array.pxi":732
 * 
 *     def __iter__(self):
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 732, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/array.pxi":733
 *     def __iter__(self):
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 733, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/array.pxi":731
 *         return self.sp_array.get().null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":735
 *             yield self.getitem(i)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_28__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_28__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_27__repr__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_27__repr__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_v_type_format = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/array.pxi":736
 * 
 *     def __repr__(self):
 *         type_format = object.__repr__(self)             # <<<<<<<<<<<<<<
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_type_format = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":737
 *     def __repr__(self):
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))             # <<<<<<<<<<<<<<
 * 
 *     def format(self, int indent=0, int window=10):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 737, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 737, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_v_type_format);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":735
 *             yield self.getitem(i)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Array.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":739
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_30format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_29format[] = "Array.format(self, int indent=0, int window=10)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_30format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_indent;
  int __pyx_v_window;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indent,&__pyx_n_s_window,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indent);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format") < 0)) __PYX_ERR(1, 739, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_indent = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_indent == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 739, __pyx_L3_error)
    } else {
      __pyx_v_indent = ((int)0);
    }
    if (values[1]) {
      __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 739, __pyx_L3_error)
    } else {
      __pyx_v_window = ((int)10);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 739, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_29format(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_indent, __pyx_v_window);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_29format(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window) {
  std::string __pyx_v_result;
  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;
  __Pyx_RefNannySetupContext("format", 0);

  /* "pyarrow/array.pxi":743
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":744
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.ap),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->ap), arrow::PrettyPrintOptions(__pyx_v_indent, __pyx_v_window), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 744, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":743
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":752
 *             )
 * 
 *         return frombytes(result)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 752, __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/array.pxi":739
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Array.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":754
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_32__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_32__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_31__str__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_31__str__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/array.pxi":755
 * 
 *     def __str__(self):
 *         return self.format()             # <<<<<<<<<<<<<<
 * 
 *     def equals(Array self, Array other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 755, __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/array.pxi":754
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Array.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":757
 *         return self.format()
 * 
 *     def equals(Array self, Array other):             # <<<<<<<<<<<<<<
 *         return self.ap.Equals(deref(other.ap))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_33equals[] = "Array.equals(self, Array other)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Array, 1, "other", 0))) __PYX_ERR(1, 757, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_33equals(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33equals(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/array.pxi":758
 * 
 *     def equals(Array self, Array other):
 *         return self.ap.Equals(deref(other.ap))             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->ap->Equals((*__pyx_v_other->ap))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":757
 *         return self.format()
 * 
 *     def equals(Array self, Array other):             # <<<<<<<<<<<<<<
 *         return self.ap.Equals(deref(other.ap))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":760
 *         return self.ap.Equals(deref(other.ap))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_36__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_36__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_35__len__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Array_35__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/array.pxi":761
 * 
 *     def __len__(self):
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":760
 *         return self.ap.Equals(deref(other.ap))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":763
 *         return self.length()
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         if self.sp_array.get():
 *             return self.sp_array.get().length()
 */

static int64_t __pyx_f_7pyarrow_3lib_5Array_length(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/array.pxi":764
 * 
 *     cdef int64_t length(self):
 *         if self.sp_array.get():             # <<<<<<<<<<<<<<
 *             return self.sp_array.get().length()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->sp_array.get() != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":765
 *     cdef int64_t length(self):
 *         if self.sp_array.get():
 *             return self.sp_array.get().length()             # <<<<<<<<<<<<<<
 *         else:
 *             return 0
 */
    __pyx_r = __pyx_v_self->sp_array.get()->length();
    goto __pyx_L0;

    /* "pyarrow/array.pxi":764
 * 
 *     cdef int64_t length(self):
 *         if self.sp_array.get():             # <<<<<<<<<<<<<<
 *             return self.sp_array.get().length()
 *         else:
 */
  }

  /* "pyarrow/array.pxi":767
 *             return self.sp_array.get().length()
 *         else:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     def isnull(self):
 */
  /*else*/ {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":763
 *         return self.length()
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         if self.sp_array.get():
 *             return self.sp_array.get().length()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":769
 *             return 0
 * 
 *     def isnull(self):             # <<<<<<<<<<<<<<
 *         raise NotImplemented
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_38isnull(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_37isnull[] = "Array.isnull(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_38isnull(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isnull (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_37isnull(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_37isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isnull", 0);

  /* "pyarrow/array.pxi":770
 * 
 *     def isnull(self):
 *         raise NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
 */
  __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
  __PYX_ERR(1, 770, __pyx_L1_error)

  /* "pyarrow/array.pxi":769
 *             return 0
 * 
 *     def isnull(self):             # <<<<<<<<<<<<<<
 *         raise NotImplemented
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.isnull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":772
 *         raise NotImplemented
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_39__getitem__[] = "\n        Return the value at the given index.\n\n        Returns\n        -------\n        value : Scalar\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_5Array_39__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_39__getitem__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_39__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_index) {
  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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/array.pxi":780
 *         value : Scalar
 *         """
 *         if PySlice_Check(index):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, index)
 * 
 */
  __pyx_t_1 = (PySlice_Check(__pyx_v_index) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":781
 *         """
 *         if PySlice_Check(index):
 *             return _normalize_slice(self, index)             # <<<<<<<<<<<<<<
 * 
 *         return self.getitem(_normalize_index(index, self.length()))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_index};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 781, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_index};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 781, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_index);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":780
 *         value : Scalar
 *         """
 *         if PySlice_Check(index):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, index)
 * 
 */
  }

  /* "pyarrow/array.pxi":783
 *             return _normalize_slice(self, index)
 * 
 *         return self.getitem(_normalize_index(index, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 783, __pyx_L1_error)
  __pyx_t_8 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 783, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":772
 *         raise NotImplemented
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* 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_6);
  __Pyx_AddTraceback("pyarrow.lib.Array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":785
 *         return self.getitem(_normalize_index(index, self.length()))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_5Array_getitem(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int64_t __pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/array.pxi":786
 * 
 *     cdef getitem(self, int64_t i):
 *         return box_scalar(self.type, self.sp_array, i)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->sp_array, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 786, __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/array.pxi":785
 *         return self.getitem(_normalize_index(index, self.length()))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":788
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_42slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_41slice[] = "Array.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this array\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of array to slice\n        length : int, default None\n            Length of slice (default is until end of Array starting from\n            offset)\n\n        Returns\n        -------\n        sliced : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_42slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(1, 788, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 788, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_41slice(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_41slice(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/array.pxi":807
 *             shared_ptr[CArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 807, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":808
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 808, __pyx_L1_error)

    /* "pyarrow/array.pxi":807
 *             shared_ptr[CArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/array.pxi":810
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.ap.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":811
 * 
 *         if length is None:
 *             result = self.ap.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.ap.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 811, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4);

    /* "pyarrow/array.pxi":810
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.ap.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/array.pxi":813
 *             result = self.ap.Slice(offset)
 *         else:
 *             result = self.ap.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 813, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 813, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/array.pxi":815
 *             result = self.ap.Slice(offset, length)
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def take(self, Array indices):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":788
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":817
 *         return pyarrow_wrap_array(result)
 * 
 *     def take(self, Array indices):             # <<<<<<<<<<<<<<
 *         """
 *         Take elements from an array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_44take(PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_43take[] = "Array.take(self, Array indices)\n\n        Take elements from an array.\n\n        The resulting array will be of the same type as the input array, with\n        elements taken from the input array at the given indices. If an index\n        is null then the taken element will be null.\n\n        Parameters\n        ----------\n        indices : Array\n            The indices of the values to extract. Array needs to be of\n            integer type.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\", \"f\"])\n        >>> indices = pa.array([0, None, 4, 3])\n        >>> arr.take(indices)\n        <pyarrow.lib.StringArray object at 0x7ffa4fc7d368>\n        [\n          \"a\",\n          null,\n          \"e\",\n          null\n        ]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_44take(PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_7pyarrow_3lib_Array, 1, "indices", 0))) __PYX_ERR(1, 817, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_43take(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_indices));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_43take(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_indices) {
   arrow::compute::TakeOptions __pyx_v_options;
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("take", 0);

  /* "pyarrow/array.pxi":854
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Take(_context(), CDatum(self.sp_array),
 *                               CDatum(indices.sp_array), options, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":855
 * 
 *         with nogil:
 *             check_status(Take(_context(), CDatum(self.sp_array),             # <<<<<<<<<<<<<<
 *                               CDatum(indices.sp_array), options, &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Take(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array),  arrow::compute::Datum(__pyx_v_indices->sp_array), __pyx_v_options, (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 855, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":854
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Take(_context(), CDatum(self.sp_array),
 *                               CDatum(indices.sp_array), options, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":858
 *                               CDatum(indices.sp_array), options, &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def filter(self, Array mask):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":817
 *         return pyarrow_wrap_array(result)
 * 
 *     def take(self, Array indices):             # <<<<<<<<<<<<<<
 *         """
 *         Take elements from an array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":860
 *         return wrap_datum(out)
 * 
 *     def filter(self, Array mask):             # <<<<<<<<<<<<<<
 *         """
 *         Filter the array with a boolean mask.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_46filter(PyObject *__pyx_v_self, PyObject *__pyx_v_mask); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_45filter[] = "Array.filter(self, Array mask)\n\n        Filter the array with a boolean mask.\n\n        Parameters\n        ----------\n        mask : Array\n            The boolean mask indicating which values to extract.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\"])\n        >>> mask = pa.array([True, False, None, False, True])\n        >>> arr.filter(mask)\n        <pyarrow.lib.StringArray object at 0x7fa826df9200>\n        [\n          \"a\",\n          null,\n          \"e\"\n        ]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_46filter(PyObject *__pyx_v_self, PyObject *__pyx_v_mask) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filter (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_7pyarrow_3lib_Array, 1, "mask", 0))) __PYX_ERR(1, 860, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_45filter(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_mask));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_45filter(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_mask) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("filter", 0);

  /* "pyarrow/array.pxi":890
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FilterKernel(_context(), CDatum(self.sp_array),
 *                                       CDatum(mask.sp_array), &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":891
 * 
 *         with nogil:
 *             check_status(FilterKernel(_context(), CDatum(self.sp_array),             # <<<<<<<<<<<<<<
 *                                       CDatum(mask.sp_array), &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status( arrow::compute::Filter(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array),  arrow::compute::Datum(__pyx_v_mask->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 891, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":890
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FilterKernel(_context(), CDatum(self.sp_array),
 *                                       CDatum(mask.sp_array), &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":894
 *                                       CDatum(mask.sp_array), &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":860
 *         return wrap_datum(out)
 * 
 *     def filter(self, Array mask):             # <<<<<<<<<<<<<<
 *         """
 *         Filter the array with a boolean mask.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":896
 *         return wrap_datum(out)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_48_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_47_to_pandas[] = "Array._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_48_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(1, 896, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 896, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.Array._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_47_to_pandas(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_47_to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_out;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_make_tz_aware = 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;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/array.pxi":899
 *         cdef:
 *             PyObject* out
 *             PandasOptions c_options = _convert_pandas_options(options)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_options))||((__pyx_v_options) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_options)->tp_name), 0))) __PYX_ERR(1, 899, __pyx_L1_error)
  __pyx_v_c_options = __pyx_f_7pyarrow_3lib__convert_pandas_options(((PyObject*)__pyx_v_options));

  /* "pyarrow/array.pxi":901
 *             PandasOptions c_options = _convert_pandas_options(options)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":902
 * 
 *         with nogil:
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,             # <<<<<<<<<<<<<<
 *                                               self, &out))
 *         result = pandas_api.series(wrap_array_output(out), name=self._name)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertArrayToPandas(__pyx_v_c_options, __pyx_v_self->sp_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 902, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":901
 *             PandasOptions c_options = _convert_pandas_options(options)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":904
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 *         result = pandas_api.series(wrap_array_output(out), name=self._name)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_series); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_wrap_array_output(__pyx_v_out); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->_name) < 0) __PYX_ERR(1, 904, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__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;
  __pyx_v_result = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":906
 *         result = pandas_api.series(wrap_array_output(out), name=self._name)
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:             # <<<<<<<<<<<<<<
 *             from pyarrow.pandas_compat import make_tz_aware
 * 
 */
  __pyx_t_5 = ((PyObject *)__pyx_v_self->type);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_TypeCheck(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_TimestampType); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_tz); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = (__pyx_t_5 != Py_None);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_6) {

    /* "pyarrow/array.pxi":907
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:
 *             from pyarrow.pandas_compat import make_tz_aware             # <<<<<<<<<<<<<<
 * 
 *             result = make_tz_aware(result, self.type.tz)
 */
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_n_s_make_tz_aware);
    __Pyx_GIVEREF(__pyx_n_s_make_tz_aware);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_make_tz_aware);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_make_tz_aware); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_make_tz_aware = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":909
 *             from pyarrow.pandas_compat import make_tz_aware
 * 
 *             result = make_tz_aware(result, self.type.tz)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_tz); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_make_tz_aware);
    __pyx_t_4 = __pyx_v_make_tz_aware; __pyx_t_2 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_1 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_result, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_result, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_result);
      __Pyx_GIVEREF(__pyx_v_result);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_v_result);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":906
 *         result = pandas_api.series(wrap_array_output(out), name=self._name)
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:             # <<<<<<<<<<<<<<
 *             from pyarrow.pandas_compat import make_tz_aware
 * 
 */
  }

  /* "pyarrow/array.pxi":911
 *             result = make_tz_aware(result, self.type.tz)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":896
 *         return wrap_datum(out)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.Array._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_make_tz_aware);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":913
 *         return result
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_50__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_49__array__[] = "Array.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_50__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__array__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__array__") < 0)) __PYX_ERR(1, 913, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dtype = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__array__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 913, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_49__array__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_dtype);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_49__array__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_v_out;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  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 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__array__", 0);

  /* "pyarrow/array.pxi":919
 *             object values
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":920
 * 
 *         with nogil:
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,             # <<<<<<<<<<<<<<
 *                                               self, &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertArrayToPandas(__pyx_v_c_options, __pyx_v_self->sp_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 920, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":919
 *             object values
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":925
 *         # wrap_array_output uses pandas to convert to Categorical, here
 *         # always convert to numpy array
 *         values = PyObject_to_object(out)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(values, dict):
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_values = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":927
 *         values = PyObject_to_object(out)
 * 
 *         if isinstance(values, dict):             # <<<<<<<<<<<<<<
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 */
  __pyx_t_3 = PyDict_Check(__pyx_v_values); 
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":928
 * 
 *         if isinstance(values, dict):
 *             values = np.take(values['dictionary'], values['indices'])             # <<<<<<<<<<<<<<
 * 
 *         if dtype is None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_take); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_values, __pyx_n_u_dictionary); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_values, __pyx_n_u_indices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_1 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 928, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 928, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_7);
      __pyx_t_5 = 0;
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/array.pxi":927
 *         values = PyObject_to_object(out)
 * 
 *         if isinstance(values, dict):             # <<<<<<<<<<<<<<
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 */
  }

  /* "pyarrow/array.pxi":930
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  __pyx_t_4 = (__pyx_v_dtype == Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":931
 * 
 *         if dtype is None:
 *             return values             # <<<<<<<<<<<<<<
 *         return values.astype(dtype)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_values);
    __pyx_r = __pyx_v_values;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":930
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  }

  /* "pyarrow/array.pxi":932
 *         if dtype is None:
 *             return values
 *         return values.astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":913
 *         return result
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.Array.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":934
 *         return values.astype(dtype)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Experimental: return a NumPy view of this array. Only primitive
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_52to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_51to_numpy[] = "Array.to_numpy(self)\n\n        Experimental: return a NumPy view of this array. Only primitive\n        arrays with the same memory layout as NumPy (i.e. integers,\n        floating point), without any nulls, are supported.\n\n        Returns\n        -------\n        array : numpy.ndarray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_52to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_51to_numpy(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_51to_numpy(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_v_buflist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  enum  arrow::Type::type __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/array.pxi":944
 *         array : numpy.ndarray
 *         """
 *         if self.null_count:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_null_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 944, __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(1, 944, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":945
 *         """
 *         if self.null_count:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 945, __pyx_L1_error)

    /* "pyarrow/array.pxi":944
 *         array : numpy.ndarray
 *         """
 *         if self.null_count:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 */
  }

  /* "pyarrow/array.pxi":947
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for primitive types.')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((enum  arrow::Type::type)__Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!(arrow::is_primitive(__pyx_t_3) != 0)) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":948
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for primitive types.')
 *         buflist = self.buffers()
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 948, __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(1, 948, __pyx_L1_error)

    /* "pyarrow/array.pxi":947
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for primitive types.')
 */
  }

  /* "pyarrow/array.pxi":950
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for primitive types.')
 *         buflist = self.buffers()             # <<<<<<<<<<<<<<
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffers); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_buflist = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":951
 *                                       'for primitive types.')
 *         buflist = self.buffers()
 *         assert len(buflist) == 2             # <<<<<<<<<<<<<<
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[
 *             self.offset:self.offset + len(self)]
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_7 = PyObject_Length(__pyx_v_buflist); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 951, __pyx_L1_error)
    if (unlikely(!((__pyx_t_7 == 2) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 951, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":952
 *         buflist = self.buffers()
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[             # <<<<<<<<<<<<<<
 *             self.offset:self.offset + len(self)]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_buflist, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_to_pandas_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":953
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[
 *             self.offset:self.offset + len(self)]             # <<<<<<<<<<<<<<
 * 
 *     def to_pylist(self):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 953, __pyx_L1_error)
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":952
 *         buflist = self.buffers()
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[             # <<<<<<<<<<<<<<
 *             self.offset:self.offset + len(self)]
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, &__pyx_t_6, &__pyx_t_9, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":934
 *         return values.astype(dtype)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Experimental: return a NumPy view of this array. Only primitive
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.Array.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buflist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":955
 *             self.offset:self.offset + len(self)]
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_54to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_53to_pylist[] = "Array.to_pylist(self)\n\n        Convert to a list of native Python objects.\n\n        Returns\n        -------\n        lst : list\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_54to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pylist (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_53to_pylist(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_53to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_8genexpr5__pyx_v_x = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("to_pylist", 0);

  /* "pyarrow/array.pxi":963
 *         lst : list
 *         """
 *         return [x.as_py() for x in self]             # <<<<<<<<<<<<<<
 * 
 *     def validate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 963, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
      __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 963, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 963, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 963, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 963, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 963, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 963, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 963, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_x, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr5__pyx_v_x, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 963, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 963, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 963, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":955
 *             self.offset:self.offset + len(self)]
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Array.to_pylist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":965
 *         return [x.as_py() for x in self]
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Perform any validation checks implemented by
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_56validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_55validate[] = "Array.validate(self)\n\n        Perform any validation checks implemented by\n        arrow::Array::Validate(). Raises exception with error message if\n        array does not validate.\n\n        Raises\n        ------\n        ArrowInvalid\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_56validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_55validate(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_55validate(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/array.pxi":975
 *         ArrowInvalid
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.ap.Validate())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":976
 *         """
 *         with nogil:
 *             check_status(self.ap.Validate())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->ap->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 976, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":975
 *         ArrowInvalid
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.ap.Validate())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":965
 *         return [x.as_py() for x in self]
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Perform any validation checks implemented by
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":979
 * 
 *     @property
 *     def offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         A relative position into another array's data, to enable zero-copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_6offset_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_6offset___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6offset___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":985
 *         operations with the physical storage buffers.
 *         """
 *         return self.sp_array.get().offset()             # <<<<<<<<<<<<<<
 * 
 *     def buffers(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->sp_array.get()->offset()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":979
 * 
 *     @property
 *     def offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         A relative position into another array's data, to enable zero-copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":987
 *         return self.sp_array.get().offset()
 * 
 *     def buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of Buffer objects pointing to this array's physical
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_58buffers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_57buffers[] = "Array.buffers(self)\n\n        Return a list of Buffer objects pointing to this array's physical\n        storage.\n\n        To correctly interpret these buffers, you need to also apply the offset\n        multiplied with the size of the stored data type.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_58buffers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("buffers (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_57buffers(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_57buffers(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("buffers", 0);

  /* "pyarrow/array.pxi":995
 *         multiplied with the size of the stored data type.
 *         """
 *         res = []             # <<<<<<<<<<<<<<
 *         _append_array_buffers(self.sp_array.get().data().get(), res)
 *         return res
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":996
 *         """
 *         res = []
 *         _append_array_buffers(self.sp_array.get().data().get(), res)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__append_array_buffers(__pyx_v_self->sp_array.get()->data().get(), __pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":997
 *         res = []
 *         _append_array_buffers(self.sp_array.get().data().get(), res)
 *         return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":987
 *         return self.sp_array.get().offset()
 * 
 *     def buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of Buffer objects pointing to this array's physical
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":239
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 *         # To allow Table to propagate metadata to pandas.Series
 *         object _name
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4type___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":241
 *         DataType type
 *         # To allow Table to propagate metadata to pandas.Series
 *         object _name             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_5_name___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_5_name___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_name);
  __pyx_r = __pyx_v_self->_name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1000
 * 
 * 
 * cdef wrap_array_output(PyObject* output):             # <<<<<<<<<<<<<<
 *     cdef object obj = PyObject_to_object(output)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_wrap_array_output(PyObject *__pyx_v_output) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("wrap_array_output", 0);

  /* "pyarrow/array.pxi":1001
 * 
 * cdef wrap_array_output(PyObject* output):
 *     cdef object obj = PyObject_to_object(output)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(obj, dict):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_output); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_obj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1003
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 */
  __pyx_t_2 = PyDict_Check(__pyx_v_obj); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":1004
 * 
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],             # <<<<<<<<<<<<<<
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_categorical_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":1005
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],             # <<<<<<<<<<<<<<
 *                                            ordered=obj['ordered'],
 *                                            fastpath=True)
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_dictionary); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_categories, __pyx_t_6) < 0) __PYX_ERR(1, 1005, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":1006
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],             # <<<<<<<<<<<<<<
 *                                            fastpath=True)
 *     else:
 */
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_ordered); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ordered, __pyx_t_6) < 0) __PYX_ERR(1, 1005, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":1007
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 *                                            fastpath=True)             # <<<<<<<<<<<<<<
 *     else:
 *         return obj
 */
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fastpath, Py_True) < 0) __PYX_ERR(1, 1005, __pyx_L1_error)

    /* "pyarrow/array.pxi":1004
 * 
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],             # <<<<<<<<<<<<<<
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":1003
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 */
  }

  /* "pyarrow/array.pxi":1009
 *                                            fastpath=True)
 *     else:
 *         return obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_r = __pyx_v_obj;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":1000
 * 
 * 
 * cdef wrap_array_output(PyObject* output):             # <<<<<<<<<<<<<<
 *     cdef object obj = PyObject_to_object(output)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.wrap_array_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1156
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListArray_from_arrays[] = "ListArray.from_arrays(offsets, values, MemoryPool pool=None)\n\n        Construct ListArray from arrays of int32 offsets and values\n\n        Parameters\n        ----------\n        offset : Array (int32 type)\n        values : Array (any type)\n\n        Returns\n        -------\n        list_array : ListArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_9ListArray_1from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_9ListArray_from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offsets = 0;
  PyObject *__pyx_v_values = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offsets,&__pyx_n_s_values,&__pyx_n_s_pool,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offsets)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, 1); __PYX_ERR(1, 1156, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1156, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offsets = values[0];
    __pyx_v_values = values[1];
    __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1156, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(1, 1156, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_from_arrays(__pyx_v_offsets, __pyx_v_values, __pyx_v_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__values = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_out;
   arrow::MemoryPool *__pyx_v_cpool;
  struct __pyx_obj_7pyarrow_3lib_Array *__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;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/array.pxi":1172
 *             Array _offsets, _values
 *             shared_ptr[CArray] out
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)             # <<<<<<<<<<<<<<
 * 
 *         _offsets = asarray(offsets, type='int32')
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_pool);

  /* "pyarrow/array.pxi":1174
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)
 * 
 *         _offsets = asarray(offsets, type='int32')             # <<<<<<<<<<<<<<
 *         _values = asarray(values)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_offsets);
  __Pyx_GIVEREF(__pyx_v_offsets);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_offsets);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_u_int32) < 0) __PYX_ERR(1, 1174, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1174, __pyx_L1_error)
  __pyx_v__offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1175
 * 
 *         _offsets = asarray(offsets, type='int32')
 *         _values = asarray(values)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_values);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1175, __pyx_L1_error)
  __pyx_v__values = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1177
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1178
 * 
 *         with nogil:
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],             # <<<<<<<<<<<<<<
 *                                                cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status( arrow::ListArray::FromArrays((__pyx_v__offsets->ap[0]), (__pyx_v__values->ap[0]), __pyx_v_cpool, (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1178, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1177
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1180
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1180, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1181
 *                                                cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1182
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1156
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and 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_AddTraceback("pyarrow.lib.ListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__offsets);
  __Pyx_XDECREF((PyObject *)__pyx_v__values);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1185
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         return self.flatten()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_6values___get__(((struct __pyx_obj_7pyarrow_3lib_ListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1186
 *     @property
 *     def values(self):
 *         return self.flatten()             # <<<<<<<<<<<<<<
 * 
 *     # TODO(wesm): Add offsets property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1186, __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/array.pxi":1185
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         return self.flatten()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ListArray.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1190
 *     # TODO(wesm): Add offsets property
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this ListArray by one level
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListArray_2flatten[] = "ListArray.flatten(self)\n\n        Unnest this ListArray by one level\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_ListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self) {
   arrow::ListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1198
 *         result : Array
 *         """
 *         cdef CListArray* arr = <CListArray*> self.ap             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(arr.values())
 * 
 */
  __pyx_v_arr = (( arrow::ListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1199
 *         """
 *         cdef CListArray* arr = <CListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr->values()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1190
 *     # TODO(wesm): Add offsets property
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this ListArray by one level
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1209
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListArray_from_arrays[] = "LargeListArray.from_arrays(offsets, values, MemoryPool pool=None)\n\n        Construct LargeListArray from arrays of int64 offsets and values\n\n        Parameters\n        ----------\n        offset : Array (int64 type)\n        values : Array (any type)\n\n        Returns\n        -------\n        list_array : LargeListArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_14LargeListArray_1from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14LargeListArray_from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offsets = 0;
  PyObject *__pyx_v_values = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offsets,&__pyx_n_s_values,&__pyx_n_s_pool,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offsets)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, 1); __PYX_ERR(1, 1209, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1209, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offsets = values[0];
    __pyx_v_values = values[1];
    __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1209, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(1, 1209, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListArray_from_arrays(__pyx_v_offsets, __pyx_v_values, __pyx_v_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__values = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_out;
   arrow::MemoryPool *__pyx_v_cpool;
  struct __pyx_obj_7pyarrow_3lib_Array *__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;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/array.pxi":1225
 *             Array _offsets, _values
 *             shared_ptr[CArray] out
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)             # <<<<<<<<<<<<<<
 * 
 *         _offsets = asarray(offsets, type='int64')
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_pool);

  /* "pyarrow/array.pxi":1227
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)
 * 
 *         _offsets = asarray(offsets, type='int64')             # <<<<<<<<<<<<<<
 *         _values = asarray(values)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_offsets);
  __Pyx_GIVEREF(__pyx_v_offsets);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_offsets);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_u_int64) < 0) __PYX_ERR(1, 1227, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1227, __pyx_L1_error)
  __pyx_v__offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1228
 * 
 *         _offsets = asarray(offsets, type='int64')
 *         _values = asarray(values)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_values);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1228, __pyx_L1_error)
  __pyx_v__values = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1230
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CLargeListArray.FromArrays(_offsets.ap[0],
 *                                                     _values.ap[0],
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1231
 * 
 *         with nogil:
 *             check_status(CLargeListArray.FromArrays(_offsets.ap[0],             # <<<<<<<<<<<<<<
 *                                                     _values.ap[0],
 *                                                     cpool, &out))
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status( arrow::LargeListArray::FromArrays((__pyx_v__offsets->ap[0]), (__pyx_v__values->ap[0]), __pyx_v_cpool, (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1231, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1230
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CLargeListArray.FromArrays(_offsets.ap[0],
 *                                                     _values.ap[0],
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1234
 *                                                     _values.ap[0],
 *                                                     cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1234, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1235
 *                                                     cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1236
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1209
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and 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_AddTraceback("pyarrow.lib.LargeListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__offsets);
  __Pyx_XDECREF((PyObject *)__pyx_v__values);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1238
 *         return result
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this LargeListArray by one level
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListArray_2flatten[] = "LargeListArray.flatten(self)\n\n        Unnest this LargeListArray by one level\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_LargeListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self) {
   arrow::LargeListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1246
 *         result : Array
 *         """
 *         cdef CLargeListArray* arr = <CLargeListArray*> self.ap             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(arr.values())
 * 
 */
  __pyx_v_arr = (( arrow::LargeListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1247
 *         """
 *         cdef CLargeListArray* arr = <CLargeListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr->values()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1238
 *         return result
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this LargeListArray by one level
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1256
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionArray_from_dense[] = "UnionArray.from_dense(Array types, Array value_offsets, list children, list field_names=None, list type_codes=None)\n\n        Construct dense UnionArray from arrays of int8 types, int32 offsets and\n        children arrays\n\n        Parameters\n        ----------\n        types : Array (int8 type)\n        value_offsets : Array (int32 type)\n        children : list\n        field_names : list\n        type_codes : list\n\n        Returns\n        -------\n        union_array : UnionArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10UnionArray_1from_dense = {"from_dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_from_dense};
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_value_offsets = 0;
  PyObject *__pyx_v_children = 0;
  PyObject *__pyx_v_field_names = 0;
  PyObject *__pyx_v_type_codes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,&__pyx_n_s_value_offsets,&__pyx_n_s_children,&__pyx_n_s_field_names,&__pyx_n_s_type_codes,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "pyarrow/array.pxi":1257
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,
 *                    list field_names=None, list type_codes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */
    values[3] = ((PyObject*)Py_None);
    values[4] = ((PyObject*)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_offsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_dense", 0, 3, 5, 1); __PYX_ERR(1, 1256, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_dense", 0, 3, 5, 2); __PYX_ERR(1, 1256, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_names);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_codes);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_dense") < 0)) __PYX_ERR(1, 1256, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_types = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[0]);
    __pyx_v_value_offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[1]);
    __pyx_v_children = ((PyObject*)values[2]);
    __pyx_v_field_names = ((PyObject*)values[3]);
    __pyx_v_type_codes = ((PyObject*)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dense", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1256, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_types), __pyx_ptype_7pyarrow_3lib_Array, 1, "types", 0))) __PYX_ERR(1, 1256, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Array, 1, "value_offsets", 0))) __PYX_ERR(1, 1256, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(1, 1256, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_names), (&PyList_Type), 1, "field_names", 1))) __PYX_ERR(1, 1257, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type_codes), (&PyList_Type), 1, "type_codes", 1))) __PYX_ERR(1, 1257, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(__pyx_v_types, __pyx_v_value_offsets, __pyx_v_children, __pyx_v_field_names, __pyx_v_type_codes);

  /* "pyarrow/array.pxi":1256
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_value_offsets, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes) {
  std::shared_ptr< arrow::Array>  __pyx_v_out;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_child = 0;
  std::vector<std::string>  __pyx_v_c_field_names;
  std::vector<uint8_t>  __pyx_v_c_type_codes;
  PyObject *__pyx_v_x = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  std::string __pyx_t_8;
  uint8_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_dense", 0);

  /* "pyarrow/array.pxi":1279
 *         cdef vector[c_string] c_field_names
 *         cdef vector[uint8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  if (unlikely(__pyx_v_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 1279, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1279, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1279, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1280
 *         cdef vector[uint8_t] c_type_codes
 *         for child in children:
 *             c.push_back(child.sp_array)             # <<<<<<<<<<<<<<
 *         if field_names is not None:
 *             for x in field_names:
 */
    try {
      __pyx_v_c.push_back(__pyx_v_child->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 1280, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1279
 *         cdef vector[c_string] c_field_names
 *         cdef vector[uint8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1281
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  __pyx_t_4 = (__pyx_v_field_names != ((PyObject*)Py_None));
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/array.pxi":1282
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    if (unlikely(__pyx_v_field_names == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1282, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1282, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1283
 *         if field_names is not None:
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 *         if type_codes is not None:
 *             for x in type_codes:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1283, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      try {
        __pyx_v_c_field_names.push_back(__pyx_t_8);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1283, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1282
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1281
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/array.pxi":1284
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  __pyx_t_5 = (__pyx_v_type_codes != ((PyObject*)Py_None));
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1285
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    if (unlikely(__pyx_v_type_codes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1285, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_type_codes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1285, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1286
 *         if type_codes is not None:
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CUnionArray.MakeDense(
 */
      __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_x); if (unlikely((__pyx_t_9 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1286, __pyx_L1_error)
      try {
        __pyx_v_c_type_codes.push_back(__pyx_t_9);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1286, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1285
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1284
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  }

  /* "pyarrow/array.pxi":1287
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeDense(
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1288
 *                 c_type_codes.push_back(x)
 *         with nogil:
 *             check_status(CUnionArray.MakeDense(             # <<<<<<<<<<<<<<
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 *                 c_type_codes, &out))
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status( arrow::UnionArray::MakeDense((*__pyx_v_types->ap), (*__pyx_v_value_offsets->ap), __pyx_v_c, __pyx_v_c_field_names, __pyx_v_c_type_codes, (&__pyx_v_out))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 1288, __pyx_L12_error)
      }

      /* "pyarrow/array.pxi":1287
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeDense(
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L13;
        }
        __pyx_L12_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L13:;
      }
  }

  /* "pyarrow/array.pxi":1291
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 *                 c_type_codes, &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1291, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1292
 *                 c_type_codes, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1293
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1256
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1296
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionArray_2from_sparse[] = "UnionArray.from_sparse(Array types, list children, list field_names=None, list type_codes=None)\n\n        Construct sparse UnionArray from arrays of int8 types and children\n        arrays\n\n        Parameters\n        ----------\n        types : Array (int8 type)\n        children : list\n        field_names : list\n        type_codes : list\n\n        Returns\n        -------\n        union_array : UnionArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10UnionArray_3from_sparse = {"from_sparse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_2from_sparse};
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types = 0;
  PyObject *__pyx_v_children = 0;
  PyObject *__pyx_v_field_names = 0;
  PyObject *__pyx_v_type_codes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_sparse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,&__pyx_n_s_children,&__pyx_n_s_field_names,&__pyx_n_s_type_codes,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject*)Py_None);

    /* "pyarrow/array.pxi":1297
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,
 *                     list type_codes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct sparse UnionArray from arrays of int8 types and children
 */
    values[3] = ((PyObject*)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_sparse", 0, 2, 4, 1); __PYX_ERR(1, 1296, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_names);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_codes);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_sparse") < 0)) __PYX_ERR(1, 1296, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_types = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[0]);
    __pyx_v_children = ((PyObject*)values[1]);
    __pyx_v_field_names = ((PyObject*)values[2]);
    __pyx_v_type_codes = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_sparse", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1296, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_types), __pyx_ptype_7pyarrow_3lib_Array, 1, "types", 0))) __PYX_ERR(1, 1296, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(1, 1296, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_names), (&PyList_Type), 1, "field_names", 1))) __PYX_ERR(1, 1296, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type_codes), (&PyList_Type), 1, "type_codes", 1))) __PYX_ERR(1, 1297, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(__pyx_v_types, __pyx_v_children, __pyx_v_field_names, __pyx_v_type_codes);

  /* "pyarrow/array.pxi":1296
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes) {
  std::shared_ptr< arrow::Array>  __pyx_v_out;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_child = 0;
  std::vector<std::string>  __pyx_v_c_field_names;
  std::vector<uint8_t>  __pyx_v_c_type_codes;
  PyObject *__pyx_v_x = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  std::string __pyx_t_8;
  uint8_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_sparse", 0);

  /* "pyarrow/array.pxi":1318
 *         cdef vector[c_string] c_field_names
 *         cdef vector[uint8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  if (unlikely(__pyx_v_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 1318, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1318, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1318, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1319
 *         cdef vector[uint8_t] c_type_codes
 *         for child in children:
 *             c.push_back(child.sp_array)             # <<<<<<<<<<<<<<
 *         if field_names is not None:
 *             for x in field_names:
 */
    try {
      __pyx_v_c.push_back(__pyx_v_child->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 1319, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1318
 *         cdef vector[c_string] c_field_names
 *         cdef vector[uint8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1320
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  __pyx_t_4 = (__pyx_v_field_names != ((PyObject*)Py_None));
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/array.pxi":1321
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    if (unlikely(__pyx_v_field_names == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1321, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1321, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1322
 *         if field_names is not None:
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 *         if type_codes is not None:
 *             for x in type_codes:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1322, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      try {
        __pyx_v_c_field_names.push_back(__pyx_t_8);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1322, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1321
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1320
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/array.pxi":1323
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  __pyx_t_5 = (__pyx_v_type_codes != ((PyObject*)Py_None));
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1324
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    if (unlikely(__pyx_v_type_codes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1324, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_type_codes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1324, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1325
 *         if type_codes is not None:
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,
 */
      __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_x); if (unlikely((__pyx_t_9 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1325, __pyx_L1_error)
      try {
        __pyx_v_c_type_codes.push_back(__pyx_t_9);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1325, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1324
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1323
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  }

  /* "pyarrow/array.pxi":1326
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,
 *                                                 c_field_names,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1327
 *                 c_type_codes.push_back(x)
 *         with nogil:
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,             # <<<<<<<<<<<<<<
 *                                                 c_field_names,
 *                                                 c_type_codes,
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status( arrow::UnionArray::MakeSparse((*__pyx_v_types->ap), __pyx_v_c, __pyx_v_c_field_names, __pyx_v_c_type_codes, (&__pyx_v_out))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L12_error)
      }

      /* "pyarrow/array.pxi":1326
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,
 *                                                 c_field_names,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L13;
        }
        __pyx_L12_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L13:;
      }
  }

  /* "pyarrow/array.pxi":1331
 *                                                 c_type_codes,
 *                                                 &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1331, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1332
 *                                                 &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1333
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1296
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1342
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringArray_from_buffers[] = "StringArray.from_buffers(int length, Buffer value_offsets, Buffer data, Buffer null_bitmap=None, int null_count=-1, int offset=0)\n\n        Construct a StringArray from value_offsets and data buffers.\n        If there are nulls in the data, also a null_bitmap and the matching\n        null_count must be passed.\n\n        Parameters\n        ----------\n        length : int\n        value_offsets : Buffer\n        data : Buffer\n        null_bitmap : Buffer, optional\n        null_count : int, default 0\n        offset : int, default 0\n\n        Returns\n        -------\n        string_array : StringArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11StringArray_1from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StringArray_from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_length;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap = 0;
  int __pyx_v_null_count;
  int __pyx_v_offset;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_buffers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_value_offsets,&__pyx_n_s_data,&__pyx_n_s_null_bitmap,&__pyx_n_s_null_count,&__pyx_n_s_offset,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "pyarrow/array.pxi":1343
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,             # <<<<<<<<<<<<<<
 *                      int offset=0):
 *         """
 */
    values[3] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_offsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 1); __PYX_ERR(1, 1342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 2); __PYX_ERR(1, 1342, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_bitmap);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_count);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(1, 1342, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1342, __pyx_L3_error)
    __pyx_v_value_offsets = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[1]);
    __pyx_v_data = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[2]);
    __pyx_v_null_bitmap = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[3]);
    if (values[4]) {
      __pyx_v_null_count = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_null_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1343, __pyx_L3_error)
    } else {
      __pyx_v_null_count = ((int)-1);
    }
    if (values[5]) {
      __pyx_v_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1344, __pyx_L3_error)
    } else {
      __pyx_v_offset = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1342, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "value_offsets", 0))) __PYX_ERR(1, 1342, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "data", 0))) __PYX_ERR(1, 1342, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_null_bitmap), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "null_bitmap", 0))) __PYX_ERR(1, 1343, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringArray_from_buffers(__pyx_v_length, __pyx_v_value_offsets, __pyx_v_data, __pyx_v_null_bitmap, __pyx_v_null_count, __pyx_v_offset);

  /* "pyarrow/array.pxi":1342
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset) {
  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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("from_buffers", 0);

  /* "pyarrow/array.pxi":1363
 *         string_array : StringArray
 *         """
 *         return Array.from_buffers(utf8(), length,             # <<<<<<<<<<<<<<
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_utf8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/array.pxi":1364
 *         """
 *         return Array.from_buffers(utf8(), length,
 *                                   [null_bitmap, value_offsets, data],             # <<<<<<<<<<<<<<
 *                                   null_count, offset)
 * 
 */
  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_null_bitmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_null_bitmap));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_null_bitmap));
  __Pyx_INCREF(((PyObject *)__pyx_v_value_offsets));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_value_offsets));
  PyList_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_value_offsets));
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  PyList_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_data));

  /* "pyarrow/array.pxi":1365
 *         return Array.from_buffers(utf8(), length,
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_null_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1363, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1363, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_9, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1342
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* 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_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.StringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1374
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringArray_from_buffers[] = "LargeStringArray.from_buffers(int length, Buffer value_offsets, Buffer data, Buffer null_bitmap=None, int null_count=-1, int offset=0)\n\n        Construct a LargeStringArray from value_offsets and data buffers.\n        If there are nulls in the data, also a null_bitmap and the matching\n        null_count must be passed.\n\n        Parameters\n        ----------\n        length : int\n        value_offsets : Buffer\n        data : Buffer\n        null_bitmap : Buffer, optional\n        null_count : int, default 0\n        offset : int, default 0\n\n        Returns\n        -------\n        string_array : StringArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_16LargeStringArray_1from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16LargeStringArray_from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_length;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap = 0;
  int __pyx_v_null_count;
  int __pyx_v_offset;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_buffers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_value_offsets,&__pyx_n_s_data,&__pyx_n_s_null_bitmap,&__pyx_n_s_null_count,&__pyx_n_s_offset,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "pyarrow/array.pxi":1375
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,             # <<<<<<<<<<<<<<
 *                      int offset=0):
 *         """
 */
    values[3] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_offsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 1); __PYX_ERR(1, 1374, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 2); __PYX_ERR(1, 1374, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_bitmap);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_count);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(1, 1374, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1374, __pyx_L3_error)
    __pyx_v_value_offsets = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[1]);
    __pyx_v_data = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[2]);
    __pyx_v_null_bitmap = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[3]);
    if (values[4]) {
      __pyx_v_null_count = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_null_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1375, __pyx_L3_error)
    } else {
      __pyx_v_null_count = ((int)-1);
    }
    if (values[5]) {
      __pyx_v_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1376, __pyx_L3_error)
    } else {
      __pyx_v_offset = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1374, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeStringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "value_offsets", 0))) __PYX_ERR(1, 1374, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "data", 0))) __PYX_ERR(1, 1374, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_null_bitmap), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "null_bitmap", 0))) __PYX_ERR(1, 1375, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringArray_from_buffers(__pyx_v_length, __pyx_v_value_offsets, __pyx_v_data, __pyx_v_null_bitmap, __pyx_v_null_count, __pyx_v_offset);

  /* "pyarrow/array.pxi":1374
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset) {
  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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("from_buffers", 0);

  /* "pyarrow/array.pxi":1395
 *         string_array : StringArray
 *         """
 *         return Array.from_buffers(large_utf8(), length,             # <<<<<<<<<<<<<<
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_large_utf8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/array.pxi":1396
 *         """
 *         return Array.from_buffers(large_utf8(), length,
 *                                   [null_bitmap, value_offsets, data],             # <<<<<<<<<<<<<<
 *                                   null_count, offset)
 * 
 */
  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_null_bitmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_null_bitmap));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_null_bitmap));
  __Pyx_INCREF(((PyObject *)__pyx_v_value_offsets));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_value_offsets));
  PyList_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_value_offsets));
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  PyList_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_data));

  /* "pyarrow/array.pxi":1397
 *         return Array.from_buffers(large_utf8(), length,
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_null_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1395, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1395, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_9, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1374
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* 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_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1417
 *     """
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_1dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryArray_dictionary_encode[] = "DictionaryArray.dictionary_encode(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_1dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_dictionary_encode(((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_dictionary_encode(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode", 0);

  /* "pyarrow/array.pxi":1418
 * 
 *     def dictionary_encode(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1417
 *     """
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1421
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_10dictionary_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_10dictionary_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_10dictionary___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_10dictionary___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1422
 *     @property
 *     def dictionary(self):
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)             # <<<<<<<<<<<<<<
 * 
 *         if self._dictionary is None:
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1424
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._dictionary is None:             # <<<<<<<<<<<<<<
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_dictionary == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1425
 * 
 *         if self._dictionary is None:
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())             # <<<<<<<<<<<<<<
 * 
 *         return self._dictionary
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->dictionary()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_dictionary);
    __Pyx_DECREF(__pyx_v_self->_dictionary);
    __pyx_v_self->_dictionary = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1424
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._dictionary is None:             # <<<<<<<<<<<<<<
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 */
  }

  /* "pyarrow/array.pxi":1427
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 *         return self._dictionary             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_dictionary);
  __pyx_r = __pyx_v_self->_dictionary;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1421
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.dictionary.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1430
 * 
 *     @property
 *     def indices(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_7indices_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_7indices___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_7indices___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1431
 *     @property
 *     def indices(self):
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)             # <<<<<<<<<<<<<<
 * 
 *         if self._indices is None:
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1433
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._indices is None:             # <<<<<<<<<<<<<<
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_indices == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1434
 * 
 *         if self._indices is None:
 *             self._indices = pyarrow_wrap_array(darr.indices())             # <<<<<<<<<<<<<<
 * 
 *         return self._indices
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->indices()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_indices);
    __Pyx_DECREF(__pyx_v_self->_indices);
    __pyx_v_self->_indices = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1433
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._indices is None:             # <<<<<<<<<<<<<<
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 */
  }

  /* "pyarrow/array.pxi":1436
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 *         return self._indices             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_indices);
  __pyx_r = __pyx_v_self->_indices;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1430
 * 
 *     @property
 *     def indices(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1439
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryArray_2from_arrays[] = "DictionaryArray.from_arrays(indices, dictionary, mask=None, bool ordered=False, bool from_pandas=False, bool safe=True, MemoryPool memory_pool=None)\n\n        Construct Arrow DictionaryArray from array of indices (must be\n        non-negative integers) and corresponding array of dictionary values\n\n        Parameters\n        ----------\n        indices : ndarray or pandas.Series, integer type\n        dictionary : ndarray or pandas.Series\n        mask : ndarray or pandas.Series, boolean type\n            True values indicate that indices are actually null\n        from_pandas : boolean, default False\n            If True, the indices should be treated as though they originated in\n            a pandas.Categorical (null encoded as -1)\n        ordered : boolean, default False\n            Set to True if the category values are ordered\n        safe : boolean, default True\n            If True, check that the dictionary indices are in range\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise uses default pool\n\n        Returns\n        -------\n        dict_array : DictionaryArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15DictionaryArray_3from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_2from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_dictionary = 0;
  PyObject *__pyx_v_mask = 0;
  int __pyx_v_ordered;
  int __pyx_v_from_pandas;
  int __pyx_v_safe;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_dictionary,&__pyx_n_s_mask,&__pyx_n_s_ordered,&__pyx_n_s_from_pandas,&__pyx_n_s_safe,&__pyx_n_s_memory_pool,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":1441
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct Arrow DictionaryArray from array of indices (must be
 */
    values[6] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 7, 1); __PYX_ERR(1, 1439, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ordered);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_pandas);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1439, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_indices = values[0];
    __pyx_v_dictionary = values[1];
    __pyx_v_mask = values[2];
    if (values[3]) {
      __pyx_v_ordered = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_ordered == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1439, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1439
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
      __pyx_v_ordered = ((int)0);
    }
    if (values[4]) {
      __pyx_v_from_pandas = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_from_pandas == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1440, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1440
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
      __pyx_v_from_pandas = ((int)0);
    }
    if (values[5]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1440, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[6]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1439, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1441, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_2from_arrays(__pyx_v_indices, __pyx_v_dictionary, __pyx_v_mask, __pyx_v_ordered, __pyx_v_from_pandas, __pyx_v_safe, __pyx_v_memory_pool);

  /* "pyarrow/array.pxi":1439
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_2from_arrays(PyObject *__pyx_v_indices, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_mask, int __pyx_v_ordered, int __pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__indices = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__dictionary = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  std::shared_ptr< arrow::Array>  __pyx_v_c_result;
  bool __pyx_v_c_ordered;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("from_arrays", 0);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":1471
 *             shared_ptr[CArray] c_result
 * 
 *         if isinstance(indices, Array):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise NotImplementedError(
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1472
 * 
 *         if isinstance(indices, Array):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 */
    __pyx_t_2 = (__pyx_v_mask != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/array.pxi":1473
 *         if isinstance(indices, Array):
 *             if mask is not None:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __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(1, 1473, __pyx_L1_error)

      /* "pyarrow/array.pxi":1472
 * 
 *         if isinstance(indices, Array):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 */
    }

    /* "pyarrow/array.pxi":1475
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices             # <<<<<<<<<<<<<<
 *         else:
 *             if from_pandas:
 */
    if (!(likely(((__pyx_v_indices) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_indices, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1475, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_indices;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v__indices = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1471
 *             shared_ptr[CArray] c_result
 * 
 *         if isinstance(indices, Array):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise NotImplementedError(
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1477
 *             _indices = indices
 *         else:
 *             if from_pandas:             # <<<<<<<<<<<<<<
 *                 if mask is None:
 *                     mask = indices == -1
 */
  /*else*/ {
    __pyx_t_1 = (__pyx_v_from_pandas != 0);
    if (__pyx_t_1) {

      /* "pyarrow/array.pxi":1478
 *         else:
 *             if from_pandas:
 *                 if mask is None:             # <<<<<<<<<<<<<<
 *                     mask = indices == -1
 *                 else:
 */
      __pyx_t_1 = (__pyx_v_mask == Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/array.pxi":1479
 *             if from_pandas:
 *                 if mask is None:
 *                     mask = indices == -1             # <<<<<<<<<<<<<<
 *                 else:
 *                     mask = mask | (indices == -1)
 */
        __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_indices, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1479, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "pyarrow/array.pxi":1478
 *         else:
 *             if from_pandas:
 *                 if mask is None:             # <<<<<<<<<<<<<<
 *                     mask = indices == -1
 *                 else:
 */
        goto __pyx_L6;
      }

      /* "pyarrow/array.pxi":1481
 *                     mask = indices == -1
 *                 else:
 *                     mask = mask | (indices == -1)             # <<<<<<<<<<<<<<
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_indices, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyNumber_Or(__pyx_v_mask, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_4);
        __pyx_t_4 = 0;
      }
      __pyx_L6:;

      /* "pyarrow/array.pxi":1477
 *             _indices = indices
 *         else:
 *             if from_pandas:             # <<<<<<<<<<<<<<
 *                 if mask is None:
 *                     mask = indices == -1
 */
    }

    /* "pyarrow/array.pxi":1482
 *                 else:
 *                     mask = mask | (indices == -1)
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(dictionary, Array):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_indices);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 1482, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 1482, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1482, __pyx_L1_error)
    __pyx_v__indices = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1484
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 *         if isinstance(dictionary, Array):             # <<<<<<<<<<<<<<
 *             _dictionary = dictionary
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_dictionary, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":1485
 * 
 *         if isinstance(dictionary, Array):
 *             _dictionary = dictionary             # <<<<<<<<<<<<<<
 *         else:
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 */
    if (!(likely(((__pyx_v_dictionary) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dictionary, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1485, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_dictionary;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v__dictionary = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":1484
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 *         if isinstance(dictionary, Array):             # <<<<<<<<<<<<<<
 *             _dictionary = dictionary
 *         else:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/array.pxi":1487
 *             _dictionary = dictionary
 *         else:
 *             _dictionary = array(dictionary, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(_indices, IntegerArray):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_dictionary);
    __Pyx_GIVEREF(__pyx_v_dictionary);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dictionary);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 1487, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1487, __pyx_L1_error)
    __pyx_v__dictionary = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L7:;

  /* "pyarrow/array.pxi":1489
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 * 
 *         if not isinstance(_indices, IntegerArray):             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must be integer type')
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v__indices), __pyx_ptype_7pyarrow_3lib_IntegerArray); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":1490
 * 
 *         if not isinstance(_indices, IntegerArray):
 *             raise ValueError('Indices must be integer type')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_bool c_ordered = ordered
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1490, __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(1, 1490, __pyx_L1_error)

    /* "pyarrow/array.pxi":1489
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 * 
 *         if not isinstance(_indices, IntegerArray):             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must be integer type')
 * 
 */
  }

  /* "pyarrow/array.pxi":1492
 *             raise ValueError('Indices must be integer type')
 * 
 *         cdef c_bool c_ordered = ordered             # <<<<<<<<<<<<<<
 * 
 *         c_type.reset(new CDictionaryType(_indices.type.sp_type,
 */
  __pyx_v_c_ordered = __pyx_v_ordered;

  /* "pyarrow/array.pxi":1494
 *         cdef c_bool c_ordered = ordered
 * 
 *         c_type.reset(new CDictionaryType(_indices.type.sp_type,             # <<<<<<<<<<<<<<
 *                                          _dictionary.sp_array.get().type(),
 *                                          c_ordered))
 */
  __pyx_v_c_type.reset(new  arrow::DictionaryType(__pyx_v__indices->type->sp_type, __pyx_v__dictionary->sp_array.get()->type(), __pyx_v_c_ordered));

  /* "pyarrow/array.pxi":1498
 *                                          c_ordered))
 * 
 *         if safe:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(
 */
  __pyx_t_2 = (__pyx_v_safe != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1499
 * 
 *         if safe:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CDictionaryArray.FromArrays(c_type, _indices.sp_array,
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":1500
 *         if safe:
 *             with nogil:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CDictionaryArray.FromArrays(c_type, _indices.sp_array,
 *                                                 _dictionary.sp_array,
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::DictionaryArray::FromArrays(__pyx_v_c_type, __pyx_v__indices->sp_array, __pyx_v__dictionary->sp_array, (&__pyx_v_c_result))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1500, __pyx_L11_error)
        }

        /* "pyarrow/array.pxi":1499
 * 
 *         if safe:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CDictionaryArray.FromArrays(c_type, _indices.sp_array,
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L12;
          }
          __pyx_L11_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L12:;
        }
    }

    /* "pyarrow/array.pxi":1498
 *                                          c_ordered))
 * 
 *         if safe:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(
 */
    goto __pyx_L9;
  }

  /* "pyarrow/array.pxi":1505
 *                                                 &c_result))
 *         else:
 *             c_result.reset(new CDictionaryArray(c_type, _indices.sp_array,             # <<<<<<<<<<<<<<
 *                                                 _dictionary.sp_array))
 * 
 */
  /*else*/ {

    /* "pyarrow/array.pxi":1506
 *         else:
 *             c_result.reset(new CDictionaryArray(c_type, _indices.sp_array,
 *                                                 _dictionary.sp_array))             # <<<<<<<<<<<<<<
 * 
 *         cdef Array result = pyarrow_wrap_array(c_result)
 */
    __pyx_v_c_result.reset(new  arrow::DictionaryArray(__pyx_v_c_type, __pyx_v__indices->sp_array, __pyx_v__dictionary->sp_array));
  }
  __pyx_L9:;

  /* "pyarrow/array.pxi":1508
 *                                                 _dictionary.sp_array))
 * 
 *         cdef Array result = pyarrow_wrap_array(c_result)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1508, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1509
 * 
 *         cdef Array result = pyarrow_wrap_array(c_result)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1510
 *         cdef Array result = pyarrow_wrap_array(c_result)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1439
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__indices);
  __Pyx_XDECREF((PyObject *)__pyx_v__dictionary);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1518
 *     """
 * 
 *     def field(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the child array belonging to field
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_1field(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_field[] = "StructArray.field(self, index)\n\n        Retrieves the child array belonging to field\n\n        Parameters\n        ----------\n        index : Union[int, str]\n            Index / position or name of the field\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_1field(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_field(((struct __pyx_obj_7pyarrow_3lib_StructArray *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_field(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, PyObject *__pyx_v_index) {
   arrow::StructArray *__pyx_v_arr;
  std::shared_ptr< arrow::Array>  __pyx_v_child;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/array.pxi":1532
 *         """
 *         cdef:
 *             CStructArray* arr = <CStructArray*> self.ap             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] child
 * 
 */
  __pyx_v_arr = (( arrow::StructArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1535
 *             shared_ptr[CArray] child
 * 
 *         if isinstance(index, six.string_types):             # <<<<<<<<<<<<<<
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_index, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1536
 * 
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))             # <<<<<<<<<<<<<<
 *             if child == nullptr:
 *                 raise KeyError(index)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_index) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_index);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1536, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_child = __pyx_v_arr->GetFieldByName(__pyx_t_6);

    /* "pyarrow/array.pxi":1537
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:             # <<<<<<<<<<<<<<
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 */
    __pyx_t_4 = ((__pyx_v_child == nullptr) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/array.pxi":1538
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 *                 raise KeyError(index)             # <<<<<<<<<<<<<<
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1538, __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(1, 1538, __pyx_L1_error)

      /* "pyarrow/array.pxi":1537
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:             # <<<<<<<<<<<<<<
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 */
    }

    /* "pyarrow/array.pxi":1535
 *             shared_ptr[CArray] child
 * 
 *         if isinstance(index, six.string_types):             # <<<<<<<<<<<<<<
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1539
 *             if child == nullptr:
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):             # <<<<<<<<<<<<<<
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_index, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/array.pxi":1541
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Expected integer or string index')
 */
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1541, __pyx_L1_error)
    __pyx_t_8 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, __pyx_v_self->__pyx_base.ap->num_fields()); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 1541, __pyx_L1_error)

    /* "pyarrow/array.pxi":1540
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(             # <<<<<<<<<<<<<<
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 *         else:
 */
    __pyx_v_child = __pyx_v_arr->field(((int)__pyx_t_8));

    /* "pyarrow/array.pxi":1539
 *             if child == nullptr:
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):             # <<<<<<<<<<<<<<
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1543
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(child)
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 1543, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1545
 *             raise TypeError('Expected integer or string index')
 * 
 *         return pyarrow_wrap_array(child)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_child); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1518
 *     """
 * 
 *     def field(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the child array belonging to field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1547
 *         return pyarrow_wrap_array(child)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this StructArray, returning one individual array for each
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_2flatten[] = "StructArray.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this StructArray, returning one individual array for each\n        field in the struct.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : List[Array]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(1, 1547, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1547, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1547, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_StructArray *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_2flatten(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_arrays;
   arrow::MemoryPool *__pyx_v_pool;
   arrow::StructArray *__pyx_v_sarr;
  std::shared_ptr< arrow::Array>  __pyx_8genexpr6__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<std::shared_ptr< arrow::Array> > ::iterator __pyx_t_3;
  std::shared_ptr< arrow::Array>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1563
 *         cdef:
 *             vector[shared_ptr[CArray]] arrays
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *             CStructArray* sarr = <CStructArray*> self.ap
 * 
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":1564
 *             vector[shared_ptr[CArray]] arrays
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *             CStructArray* sarr = <CStructArray*> self.ap             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_sarr = (( arrow::StructArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1566
 *             CStructArray* sarr = <CStructArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1567
 * 
 *         with nogil:
 *             check_status(sarr.Flatten(pool, &arrays))             # <<<<<<<<<<<<<<
 * 
 *         return [pyarrow_wrap_array(arr) for arr in arrays]
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_sarr->Flatten(__pyx_v_pool, (&__pyx_v_arrays))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1567, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1566
 *             CStructArray* sarr = <CStructArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1569
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 *         return [pyarrow_wrap_array(arr) for arr in arrays]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_arrays.begin();
    for (;;) {
      if (!(__pyx_t_3 != __pyx_v_arrays.end())) break;
      __pyx_t_4 = *__pyx_t_3;
      ++__pyx_t_3;
      __pyx_8genexpr6__pyx_v_arr = __pyx_t_4;
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_8genexpr6__pyx_v_arr); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1569, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1547
 *         return pyarrow_wrap_array(child)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this StructArray, returning one individual array for each
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1572
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_4from_arrays[] = "StructArray.from_arrays(arrays, names=None, fields=None)\n\n        Construct StructArray from collection of arrays representing\n        each field in the struct.\n\n        Either field names or field instances must be passed.\n\n        Parameters\n        ----------\n        arrays : sequence of Array\n        names : List[str] (optional)\n            Field names for each struct child\n        fields : List[Field] (optional)\n            Field instances for each struct child\n\n        Returns\n        -------\n        result : StructArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11StructArray_5from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_4from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_names,&__pyx_n_s_fields,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1572, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_names = values[1];
    __pyx_v_fields = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1572, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_4from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_fields);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_4from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_fields) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  std::vector<std::string>  __pyx_v_c_names;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  arrow::Result<std::shared_ptr< arrow::Array> >  __pyx_v_c_result;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_py_field = 0;
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_item = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_8genexpr7__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  std::string __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  std::shared_ptr< arrow::Array>  __pyx_t_15;
  __Pyx_RefNannySetupContext("from_arrays", 0);
  __Pyx_INCREF(__pyx_v_arrays);

  /* "pyarrow/array.pxi":1603
 *             DataType struct_type
 * 
 *         if names is None and fields is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 */
  __pyx_t_2 = (__pyx_v_names == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_fields == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":1604
 * 
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')             # <<<<<<<<<<<<<<
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1604, __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(1, 1604, __pyx_L1_error)

    /* "pyarrow/array.pxi":1603
 *             DataType struct_type
 * 
 *         if names is None and fields is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 */
  }

  /* "pyarrow/array.pxi":1605
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields, not both')
 * 
 */
  __pyx_t_2 = (__pyx_v_names != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_fields != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":1606
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')             # <<<<<<<<<<<<<<
 * 
 *         arrays = [asarray(x) for x in arrays]
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1606, __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(1, 1606, __pyx_L1_error)

    /* "pyarrow/array.pxi":1605
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields, not both')
 * 
 */
  }

  /* "pyarrow/array.pxi":1608
 *             raise ValueError('Must pass either names or fields, not both')
 * 
 *         arrays = [asarray(x) for x in arrays]             # <<<<<<<<<<<<<<
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1608, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
      __pyx_t_5 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1608, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1608, __pyx_L11_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1608, __pyx_L11_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1608, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1608, __pyx_L11_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1608, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1608, __pyx_L11_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1608, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_8genexpr7__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr7__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1608, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(1, 1608, __pyx_L11_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_arrays, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1609
 * 
 *         arrays = [asarray(x) for x in arrays]
 *         for arr in arrays:             # <<<<<<<<<<<<<<
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 */
  if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
    __pyx_t_4 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1609, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1609, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1609, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 1609, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/array.pxi":1610
 *         arrays = [asarray(x) for x in arrays]
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             for name in names:
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(__pyx_v_arr));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 1610, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1609
 * 
 *         arrays = [asarray(x) for x in arrays]
 *         for arr in arrays:             # <<<<<<<<<<<<<<
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1611
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             for name in names:
 *                 c_names.push_back(tobytes(name))
 */
  __pyx_t_1 = (__pyx_v_names != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1612
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 *             for name in names:             # <<<<<<<<<<<<<<
 *                 c_names.push_back(tobytes(name))
 *         else:
 */
    if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
      __pyx_t_4 = __pyx_v_names; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1612, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1612, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1612, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1612, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1612, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1612, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":1613
 *         if names is not None:
 *             for name in names:
 *                 c_names.push_back(tobytes(name))             # <<<<<<<<<<<<<<
 *         else:
 *             for item in fields:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1613, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      try {
        __pyx_v_c_names.push_back(__pyx_t_11);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1613, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1612
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 *             for name in names:             # <<<<<<<<<<<<<<
 *                 c_names.push_back(tobytes(name))
 *         else:
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":1611
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             for name in names:
 *                 c_names.push_back(tobytes(name))
 */
    goto __pyx_L17;
  }

  /* "pyarrow/array.pxi":1615
 *                 c_names.push_back(tobytes(name))
 *         else:
 *             for item in fields:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, tuple):
 *                     py_field = field(*item)
 */
  /*else*/ {
    if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
      __pyx_t_4 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1615, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1615, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1615, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1615, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1615, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1615, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1615, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":1616
 *         else:
 *             for item in fields:
 *                 if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *                     py_field = field(*item)
 *                 else:
 */
      __pyx_t_2 = PyTuple_Check(__pyx_v_item); 
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "pyarrow/array.pxi":1617
 *             for item in fields:
 *                 if isinstance(item, tuple):
 *                     py_field = field(*item)             # <<<<<<<<<<<<<<
 *                 else:
 *                     py_field = item
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(1, 1617, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_9));
        __pyx_t_9 = 0;

        /* "pyarrow/array.pxi":1616
 *         else:
 *             for item in fields:
 *                 if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *                     py_field = field(*item)
 *                 else:
 */
        goto __pyx_L22;
      }

      /* "pyarrow/array.pxi":1619
 *                     py_field = field(*item)
 *                 else:
 *                     py_field = item             # <<<<<<<<<<<<<<
 *                 c_fields.push_back(py_field.sp_field)
 * 
 */
      /*else*/ {
        if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(1, 1619, __pyx_L1_error)
        __pyx_t_9 = __pyx_v_item;
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_9));
        __pyx_t_9 = 0;
      }
      __pyx_L22:;

      /* "pyarrow/array.pxi":1620
 *                 else:
 *                     py_field = item
 *                 c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and
 */
      try {
        __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1620, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1615
 *                 c_names.push_back(tobytes(name))
 *         else:
 *             for item in fields:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, tuple):
 *                     py_field = field(*item)
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L17:;

  /* "pyarrow/array.pxi":1622
 *                 c_fields.push_back(py_field.sp_field)
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and             # <<<<<<<<<<<<<<
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 */
  __pyx_t_2 = ((__pyx_v_c_arrays.size() == 0) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L24_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_c_names.size() == 0) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L24_bool_binop_done;
  }

  /* "pyarrow/array.pxi":1623
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and
 *                 c_fields.size() == 0):             # <<<<<<<<<<<<<<
 *             # The C++ side doesn't allow this
 *             return array([], struct([]))
 */
  __pyx_t_2 = ((__pyx_v_c_fields.size() == 0) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L24_bool_binop_done:;

  /* "pyarrow/array.pxi":1622
 *                 c_fields.push_back(py_field.sp_field)
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and             # <<<<<<<<<<<<<<
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 */
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":1625
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 *             return array([], struct([]))             # <<<<<<<<<<<<<<
 * 
 *         if names is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_struct); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_14 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_14 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1625, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1625, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1625, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_5);
      __pyx_t_8 = 0;
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1625, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":1622
 *                 c_fields.push_back(py_field.sp_field)
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and             # <<<<<<<<<<<<<<
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 */
  }

  /* "pyarrow/array.pxi":1627
 *             return array([], struct([]))
 * 
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             # XXX Cannot pass "nullptr" for a shared_ptr<T> argument:
 *             # https://github.com/cython/cython/issues/3020
 */
  __pyx_t_1 = (__pyx_v_names != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1630
 *             # XXX Cannot pass "nullptr" for a shared_ptr<T> argument:
 *             # https://github.com/cython/cython/issues/3020
 *             c_result = CStructArray.MakeFromFieldNames(             # <<<<<<<<<<<<<<
 *                 c_arrays, c_names, shared_ptr[CBuffer](), -1, 0)
 *         else:
 */
    __pyx_v_c_result =  arrow::StructArray::Make(__pyx_v_c_arrays, __pyx_v_c_names, std::shared_ptr< arrow::Buffer> (), -1L, 0);

    /* "pyarrow/array.pxi":1627
 *             return array([], struct([]))
 * 
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             # XXX Cannot pass "nullptr" for a shared_ptr<T> argument:
 *             # https://github.com/cython/cython/issues/3020
 */
    goto __pyx_L27;
  }

  /* "pyarrow/array.pxi":1633
 *                 c_arrays, c_names, shared_ptr[CBuffer](), -1, 0)
 *         else:
 *             c_result = CStructArray.MakeFromFields(             # <<<<<<<<<<<<<<
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 */
  /*else*/ {

    /* "pyarrow/array.pxi":1634
 *         else:
 *             c_result = CStructArray.MakeFromFields(
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()
 */
    __pyx_v_c_result =  arrow::StructArray::Make(__pyx_v_c_arrays, __pyx_v_c_fields, std::shared_ptr< arrow::Buffer> (), -1L, 0);
  }
  __pyx_L27:;

  /* "pyarrow/array.pxi":1635
 *             c_result = CStructArray.MakeFromFields(
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_15 = arrow::py::GetResultValue<std::shared_ptr< arrow::Array> >(__pyx_v_c_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1635, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1635, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1636
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_4 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1637
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1572
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_field);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1646
 * 
 *     @property
 *     def storage(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_7storage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_7storage_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14ExtensionArray_7storage___get__(((struct __pyx_obj_7pyarrow_3lib_ExtensionArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_7storage___get__(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self) {
   arrow::ExtensionArray *__pyx_v_ext_array;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1648
 *     def storage(self):
 *         cdef:
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(ext_array.storage())
 */
  __pyx_v_ext_array = (( arrow::ExtensionArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1650
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)
 * 
 *         return pyarrow_wrap_array(ext_array.storage())             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_ext_array->storage()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1646
 * 
 *     @property
 *     def storage(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray.storage.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1653
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14ExtensionArray_from_storage[] = "ExtensionArray.from_storage(BaseExtensionType typ, Array storage)\n\n        Construct ExtensionArray from type and storage array.\n\n        Parameters\n        ----------\n        typ: DataType\n            The extension type for the result array.\n        storage: Array\n            The underlying storage for the result array.\n\n        Returns\n        -------\n        ext_array : ExtensionArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_14ExtensionArray_1from_storage = {"from_storage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14ExtensionArray_from_storage};
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_typ = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_storage = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_storage (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_storage,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_storage", 1, 2, 2, 1); __PYX_ERR(1, 1653, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_storage") < 0)) __PYX_ERR(1, 1653, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_typ = ((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)values[0]);
    __pyx_v_storage = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_storage", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1653, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray.from_storage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typ), __pyx_ptype_7pyarrow_3lib_BaseExtensionType, 1, "typ", 0))) __PYX_ERR(1, 1653, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), __pyx_ptype_7pyarrow_3lib_Array, 1, "storage", 0))) __PYX_ERR(1, 1653, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_14ExtensionArray_from_storage(__pyx_v_typ, __pyx_v_storage);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_from_storage(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_typ, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_storage) {
  std::shared_ptr< arrow::ExtensionArray>  __pyx_v_ext_array;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  std::shared_ptr< arrow::ExtensionArray>  __pyx_t_7;
  __Pyx_RefNannySetupContext("from_storage", 0);

  /* "pyarrow/array.pxi":1671
 *             shared_ptr[CExtensionArray] ext_array
 * 
 *         if storage.type != typ.storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Incompatible storage type {0} "
 *                             "for extension type {1}".format(storage.type, typ))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_typ), __pyx_n_s_storage_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_storage->type), __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 1671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/array.pxi":1673
 *         if storage.type != typ.storage_type:
 *             raise TypeError("Incompatible storage type {0} "
 *                             "for extension type {1}".format(storage.type, typ))             # <<<<<<<<<<<<<<
 * 
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Incompatible_storage_type_0_for, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_storage->type), ((PyObject *)__pyx_v_typ)};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1673, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_storage->type), ((PyObject *)__pyx_v_typ)};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1673, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_storage->type));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_storage->type));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_storage->type));
      __Pyx_INCREF(((PyObject *)__pyx_v_typ));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_typ));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_typ));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1672
 * 
 *         if storage.type != typ.storage_type:
 *             raise TypeError("Incompatible storage type {0} "             # <<<<<<<<<<<<<<
 *                             "for extension type {1}".format(storage.type, typ))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 1672, __pyx_L1_error)

    /* "pyarrow/array.pxi":1671
 *             shared_ptr[CExtensionArray] ext_array
 * 
 *         if storage.type != typ.storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Incompatible storage type {0} "
 *                             "for extension type {1}".format(storage.type, typ))
 */
  }

  /* "pyarrow/array.pxi":1675
 *                             "for extension type {1}".format(storage.type, typ))
 * 
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)
 *         result.validate()
 */
  try {
    __pyx_t_7 = std::make_shared< arrow::ExtensionArray>(__pyx_v_typ->__pyx_base.sp_type, __pyx_v_storage->sp_array);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(1, 1675, __pyx_L1_error)
  }
  __pyx_v_ext_array = __pyx_t_7;

  /* "pyarrow/array.pxi":1676
 * 
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(((std::shared_ptr< arrow::Array> )__pyx_v_ext_array)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1676, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1677
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1678
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1653
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */

  /* 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_6);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray.from_storage", __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/array.pxi":1715
 * 
 * 
 * cdef object get_series_values(object obj, bint* is_series):             # <<<<<<<<<<<<<<
 *     if pandas_api.is_series(obj):
 *         result = obj.values
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_series_values(PyObject *__pyx_v_obj, int *__pyx_v_is_series) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("get_series_values", 0);

  /* "pyarrow/array.pxi":1716
 * 
 * cdef object get_series_values(object obj, bint* is_series):
 *     if pandas_api.is_series(obj):             # <<<<<<<<<<<<<<
 *         result = obj.values
 *         is_series[0] = True
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_series(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1716, __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(1, 1716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1717
 * cdef object get_series_values(object obj, bint* is_series):
 *     if pandas_api.is_series(obj):
 *         result = obj.values             # <<<<<<<<<<<<<<
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1718
 *     if pandas_api.is_series(obj):
 *         result = obj.values
 *         is_series[0] = True             # <<<<<<<<<<<<<<
 *     elif isinstance(obj, np.ndarray):
 *         result = obj
 */
    (__pyx_v_is_series[0]) = 1;

    /* "pyarrow/array.pxi":1716
 * 
 * cdef object get_series_values(object obj, bint* is_series):
 *     if pandas_api.is_series(obj):             # <<<<<<<<<<<<<<
 *         result = obj.values
 *         is_series[0] = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1719
 *         result = obj.values
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         result = obj
 *         is_series[0] = False
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1720
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):
 *         result = obj             # <<<<<<<<<<<<<<
 *         is_series[0] = False
 *     else:
 */
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_v_result = __pyx_v_obj;

    /* "pyarrow/array.pxi":1721
 *     elif isinstance(obj, np.ndarray):
 *         result = obj
 *         is_series[0] = False             # <<<<<<<<<<<<<<
 *     else:
 *         result = pandas_api.series(obj).values
 */
    (__pyx_v_is_series[0]) = 0;

    /* "pyarrow/array.pxi":1719
 *         result = obj.values
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         result = obj
 *         is_series[0] = False
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1723
 *         is_series[0] = False
 *     else:
 *         result = pandas_api.series(obj).values             # <<<<<<<<<<<<<<
 *         is_series[0] = False
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1724
 *     else:
 *         result = pandas_api.series(obj).values
 *         is_series[0] = False             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    (__pyx_v_is_series[0]) = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1726
 *         is_series[0] = False
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1715
 * 
 * 
 * cdef object get_series_values(object obj, bint* is_series):             # <<<<<<<<<<<<<<
 *     if pandas_api.is_series(obj):
 *         result = obj.values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.get_series_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1729
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_135concat_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_134concat_arrays[] = "concat_arrays(arrays, MemoryPool memory_pool=None)\n\n    Returns a concatenation of the given arrays. The contents of those arrays\n    are copied into the returned array. Raises exception if all of the arrays\n    are not of the same type.\n\n    Parameters\n    ----------\n    arrays : iterable of pyarrow.Array objects\n    memory_pool : MemoryPool, default None\n        For memory allocations. If None, the default pool is used.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_135concat_arrays = {"concat_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_135concat_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_134concat_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_135concat_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_memory_pool,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "concat_arrays") < 0)) __PYX_ERR(1, 1729, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("concat_arrays", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1729, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.concat_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1729, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_134concat_arrays(__pyx_self, __pyx_v_arrays, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_134concat_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  std::shared_ptr< arrow::Array>  __pyx_v_c_result;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_array = 0;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("concat_arrays", 0);

  /* "pyarrow/array.pxi":1745
 *         shared_ptr[CArray] c_result
 *         Array array
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     for array in arrays:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":1747
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     for array in arrays:             # <<<<<<<<<<<<<<
 *         c_arrays.push_back(array.sp_array)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
    __pyx_t_1 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1747, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1747, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1747, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 1747, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1747, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_array, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":1748
 * 
 *     for array in arrays:
 *         c_arrays.push_back(array.sp_array)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_v_array->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 1748, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1747
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     for array in arrays:             # <<<<<<<<<<<<<<
 *         c_arrays.push_back(array.sp_array)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1750
 *         c_arrays.push_back(array.sp_array)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(Concatenate(c_arrays, pool, &c_result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1751
 * 
 *     with nogil:
 *         check_status(Concatenate(c_arrays, pool, &c_result))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_array(c_result)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::Concatenate(__pyx_v_c_arrays, __pyx_v_pool, (&__pyx_v_c_result))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1751, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":1750
 *         c_arrays.push_back(array.sp_array)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(Concatenate(c_arrays, pool, &c_result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/array.pxi":1753
 *         check_status(Concatenate(c_arrays, pool, &c_result))
 * 
 *     return pyarrow_wrap_array(c_result)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1729
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.concat_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":32
 *         unique_ptr[CStringBuilder] builder
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         self.builder.reset(new CStringBuilder(pool))
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13StringBuilder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13StringBuilder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(11, 32, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(11, 32, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(11, 32, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder___cinit__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13StringBuilder___cinit__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_v_pool;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/builder.pxi":33
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *         self.builder.reset(new CStringBuilder(pool))
 * 
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/builder.pxi":34
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         self.builder.reset(new CStringBuilder(pool))             # <<<<<<<<<<<<<<
 * 
 *     def append(self, value):
 */
  __pyx_v_self->builder.reset(new  arrow::StringBuilder(__pyx_v_pool));

  /* "pyarrow/builder.pxi":32
 *         unique_ptr[CStringBuilder] builder
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         self.builder.reset(new CStringBuilder(pool))
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":36
 *         self.builder.reset(new CStringBuilder(pool))
 * 
 *     def append(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Append a single value to the builder. The value can either be a
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_3append(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_2append[] = "StringBuilder.append(self, value)\n\n        Append a single value to the builder. The value can either be a\n        string/bytes object or a null value (np.nan or None).\n\n        Parameters\n        ----------\n        value : string/bytes or np.nan/None\n            The value to append to the string array builder\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_3append(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_2append(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_2append(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __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;
  std::string __pyx_t_7;
  __Pyx_RefNannySetupContext("append", 0);

  /* "pyarrow/builder.pxi":46
 *             The value to append to the string array builder
 *         """
 *         if value is None or value is np.nan:             # <<<<<<<<<<<<<<
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 */
  __pyx_t_2 = (__pyx_v_value == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_v_value == __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/builder.pxi":47
 *         """
 *         if value is None or value is np.nan:
 *             self.builder.get().AppendNull()             # <<<<<<<<<<<<<<
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 *             self.builder.get().Append(tobytes(value))
 */
    (void)(__pyx_v_self->builder.get()->AppendNull());

    /* "pyarrow/builder.pxi":46
 *             The value to append to the string array builder
 *         """
 *         if value is None or value is np.nan:             # <<<<<<<<<<<<<<
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/builder.pxi":48
 *         if value is None or value is np.nan:
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):             # <<<<<<<<<<<<<<
 *             self.builder.get().Append(tobytes(value))
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_string_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_binary_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_4); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_value, __pyx_t_6); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/builder.pxi":49
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 *             self.builder.get().Append(tobytes(value))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('StringBuilder only accepts string objects')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 49, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (void)(__pyx_v_self->builder.get()->Append(__pyx_t_7));

    /* "pyarrow/builder.pxi":48
 *         if value is None or value is np.nan:
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):             # <<<<<<<<<<<<<<
 *             self.builder.get().Append(tobytes(value))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/builder.pxi":51
 *             self.builder.get().Append(tobytes(value))
 *         else:
 *             raise TypeError('StringBuilder only accepts string objects')             # <<<<<<<<<<<<<<
 * 
 *     def append_values(self, values):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 51, __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(11, 51, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/builder.pxi":36
 *         self.builder.reset(new CStringBuilder(pool))
 * 
 *     def append(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Append a single value to the builder. The value can either be a
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":53
 *             raise TypeError('StringBuilder only accepts string objects')
 * 
 *     def append_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Append all the values in an iterable to the string array builder
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_5append_values(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_4append_values[] = "StringBuilder.append_values(self, values)\n\n        Append all the values in an iterable to the string array builder\n        object.\n\n        Parameters\n        ----------\n        values : iterable of string/bytes or np.nan/None values\n            The values to append to the string array builder\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_5append_values(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append_values (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_4append_values(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_values));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_4append_values(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("append_values", 0);

  /* "pyarrow/builder.pxi":63
 *             The values to append to the string array builder
 *         """
 *         for value in values:             # <<<<<<<<<<<<<<
 *             self.append(value)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
    __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 63, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(11, 63, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(11, 63, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(11, 63, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/builder.pxi":64
 *         """
 *         for value in values:
 *             self.append(value)             # <<<<<<<<<<<<<<
 * 
 *     def finish(self):
 */
    __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self), __pyx_v_value); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(11, 64, __pyx_L1_error)

    /* "pyarrow/builder.pxi":63
 *             The values to append to the string array builder
 *         """
 *         for value in values:             # <<<<<<<<<<<<<<
 *             self.append(value)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/builder.pxi":53
 *             raise TypeError('StringBuilder only accepts string objects')
 * 
 *     def append_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Append all the values in an iterable to the string array builder
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.append_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":66
 *             self.append(value)
 * 
 *     def finish(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return result of builder as an Array object; also resets the builder.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_7finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_6finish[] = "StringBuilder.finish(self)\n\n        Return result of builder as an Array object; also resets the builder.\n\n        Returns\n        -------\n        array : pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_7finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finish (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_6finish(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_6finish(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  std::shared_ptr< arrow::Array>  __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("finish", 0);

  /* "pyarrow/builder.pxi":75
 *         """
 *         cdef shared_ptr[CArray] out
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.builder.get().Finish(&out)
 *         return pyarrow_wrap_array(out)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/builder.pxi":76
 *         cdef shared_ptr[CArray] out
 *         with nogil:
 *             self.builder.get().Finish(&out)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(out)
 * 
 */
        (void)(__pyx_v_self->builder.get()->Finish((&__pyx_v_out)));
      }

      /* "pyarrow/builder.pxi":75
 *         """
 *         cdef shared_ptr[CArray] out
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.builder.get().Finish(&out)
 *         return pyarrow_wrap_array(out)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/builder.pxi":77
 *         with nogil:
 *             self.builder.get().Finish(&out)
 *         return pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/builder.pxi":66
 *             self.append(value)
 * 
 *     def finish(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return result of builder as an Array object; also resets the builder.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.finish", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":80
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().null_count()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_10null_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_10null_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_10null_count___get__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/builder.pxi":81
 *     @property
 *     def null_count(self):
 *         return self.builder.get().null_count()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->builder.get()->null_count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/builder.pxi":80
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().null_count()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.null_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":83
 *         return self.builder.get().null_count()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().length()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_8__len__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_13StringBuilder_8__len__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/builder.pxi":84
 * 
 *     def __len__(self):
 *         return self.builder.get().length()             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_self->builder.get()->length();
  goto __pyx_L0;

  /* "pyarrow/builder.pxi":83
 *         return self.builder.get().null_count()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().length()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_10__reduce_cython__[] = "StringBuilder.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_12__setstate_cython__[] = "StringBuilder.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":29
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.chunked_array = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray___cinit__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_12ChunkedArray___cinit__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/table.pxi":30
 * 
 *     def __cinit__(self):
 *         self.chunked_array = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->chunked_array = NULL;

  /* "pyarrow/table.pxi":29
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.chunked_array = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":32
 *         self.chunked_array = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "
 *                         "`chunked_array` function instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_2__init__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_12ChunkedArray_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/table.pxi":33
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`chunked_array` function instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 33, __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(12, 33, __pyx_L1_error)

  /* "pyarrow/table.pxi":32
 *         self.chunked_array = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "
 *                         "`chunked_array` function instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":36
 *                         "`chunked_array` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):             # <<<<<<<<<<<<<<
 *         self.sp_chunked_array = chunked_array
 *         self.chunked_array = chunked_array.get()
 */

static void __pyx_f_7pyarrow_3lib_12ChunkedArray_init(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, std::shared_ptr< arrow::ChunkedArray>  const &__pyx_v_chunked_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/table.pxi":37
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):
 *         self.sp_chunked_array = chunked_array             # <<<<<<<<<<<<<<
 *         self.chunked_array = chunked_array.get()
 * 
 */
  __pyx_v_self->sp_chunked_array = __pyx_v_chunked_array;

  /* "pyarrow/table.pxi":38
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):
 *         self.sp_chunked_array = chunked_array
 *         self.chunked_array = chunked_array.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->chunked_array = __pyx_v_chunked_array.get();

  /* "pyarrow/table.pxi":36
 *                         "`chunked_array` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):             # <<<<<<<<<<<<<<
 *         self.sp_chunked_array = chunked_array
 *         self.chunked_array = chunked_array.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/table.pxi":40
 *         self.chunked_array = chunked_array.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return chunked_array, (self.chunks, self.type)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_4__reduce__[] = "ChunkedArray.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_4__reduce__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4__reduce__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/table.pxi":41
 * 
 *     def __reduce__(self):
 *         return chunked_array, (self.chunks, self.type)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":40
 *         self.chunked_array = chunked_array.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return chunked_array, (self.chunks, self.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.lib.ChunkedArray.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":44
 * 
 *     @property
 *     def data(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4data_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_4data___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4data___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":45
 *     @property
 *     def data(self):
 *         import warnings             # <<<<<<<<<<<<<<
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 *                       "compatibility after Column was removed, simply drop "
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_warnings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":46
 *     def data(self):
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "             # <<<<<<<<<<<<<<
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/table.pxi":48
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 46, __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;

  /* "pyarrow/table.pxi":49
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":44
 * 
 *     @property
 *     def data(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":52
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_4type___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4type___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":53
 *     @property
 *     def type(self):
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->sp_chunked_array.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":52
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":55
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         return self.chunked_array.length()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_7length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_6length[] = "ChunkedArray.length(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_7length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_6length(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6length(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/table.pxi":56
 * 
 *     def length(self):
 *         return self.chunked_array.length()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":55
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         return self.chunked_array.length()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":58
 *         return self.chunked_array.length()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_8__len__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_12ChunkedArray_8__len__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/table.pxi":59
 * 
 *     def __len__(self):
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":58
 *         return self.chunked_array.length()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":61
 *         return self.length()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_11__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_11__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_10__repr__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10__repr__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_v_type_format = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/table.pxi":62
 * 
 *     def __repr__(self):
 *         type_format = object.__repr__(self)             # <<<<<<<<<<<<<<
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_type_format = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":63
 *     def __repr__(self):
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))             # <<<<<<<<<<<<<<
 * 
 *     def format(self, int indent=0, int window=10):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 63, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 63, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_v_type_format);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":61
 *         return self.length()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":65
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_13format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_12format[] = "ChunkedArray.format(self, int indent=0, int window=10)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_13format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_indent;
  int __pyx_v_window;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indent,&__pyx_n_s_window,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indent);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format") < 0)) __PYX_ERR(12, 65, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_indent = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_indent == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 65, __pyx_L3_error)
    } else {
      __pyx_v_indent = ((int)0);
    }
    if (values[1]) {
      __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 65, __pyx_L3_error)
    } else {
      __pyx_v_window = ((int)10);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 65, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_12format(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_indent, __pyx_v_window);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_12format(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window) {
  std::string __pyx_v_result;
  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;
  __Pyx_RefNannySetupContext("format", 0);

  /* "pyarrow/table.pxi":69
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":70
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.chunked_array),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->chunked_array), arrow::PrettyPrintOptions(__pyx_v_indent, __pyx_v_window), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 70, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":69
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":78
 *             )
 * 
 *         return frombytes(result)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 78, __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/table.pxi":65
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":80
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_15__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_15__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_14__str__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_14__str__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/table.pxi":81
 * 
 *     def __str__(self):
 *         return self.format()             # <<<<<<<<<<<<<<
 * 
 *     def validate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 81, __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/table.pxi":80
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":83
 *         return self.format()
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate chunked array consistency.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_17validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_16validate[] = "ChunkedArray.validate(self)\n\n        Validate chunked array consistency.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_17validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_16validate(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_16validate(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/table.pxi":87
 *         Validate chunked array consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.sp_chunked_array.get().Validate())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":88
 *         """
 *         with nogil:
 *             check_status(self.sp_chunked_array.get().Validate())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->sp_chunked_array.get()->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 88, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":87
 *         Validate chunked array consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.sp_chunked_array.get().Validate())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":83
 *         return self.format()
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate chunked array consistency.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":91
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of null entires
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10null_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10null_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_10null_count___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":99
 *         int
 *         """
 *         return self.chunked_array.null_count()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->null_count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":91
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of null entires
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.null_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_20generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":101
 *         return self.chunked_array.null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_19__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_19__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_18__iter__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_18__iter__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(12, 101, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_12ChunkedArray_20generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ChunkedArray___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(12, 101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_20generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(12, 101, __pyx_L1_error)

  /* "pyarrow/table.pxi":102
 * 
 *     def __iter__(self):
 *         for chunk in self.iterchunks():             # <<<<<<<<<<<<<<
 *             for item in chunk:
 *                 yield item
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_iterchunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 102, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 102, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 102, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 102, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 102, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 102, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":103
 *     def __iter__(self):
 *         for chunk in self.iterchunks():
 *             for item in chunk:             # <<<<<<<<<<<<<<
 *                 yield item
 * 
 */
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_chunk)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_chunk)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_chunk; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_chunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 103, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(12, 103, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 103, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(12, 103, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 103, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 103, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/table.pxi":104
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 *                 yield item             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_item);
      __pyx_r = __pyx_cur_scope->__pyx_v_item;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_5;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_6;
      __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
      __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_L8_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_3;
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_4;
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_5;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(12, 104, __pyx_L1_error)

      /* "pyarrow/table.pxi":103
 *     def __iter__(self):
 *         for chunk in self.iterchunks():
 *             for item in chunk:             # <<<<<<<<<<<<<<
 *                 yield item
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":102
 * 
 *     def __iter__(self):
 *         for chunk in self.iterchunks():             # <<<<<<<<<<<<<<
 *             for item in chunk:
 *                 yield item
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/table.pxi":101
 *         return self.chunked_array.null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":106
 *                 yield item
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_22__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_22__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_21__getitem__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_21__getitem__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int64_t __pyx_t_8;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":107
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":108
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 *         elif isinstance(key, six.integer_types):
 *             return self.getitem(key)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 108, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 108, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_key);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":107
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 */
  }

  /* "pyarrow/table.pxi":109
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.getitem(key)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_key, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/table.pxi":110
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 *             return self.getitem(key)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("key must either be a slice or integer")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 110, __pyx_L1_error)
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *)__pyx_v_self->__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":109
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.getitem(key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":112
 *             return self.getitem(key)
 *         else:
 *             raise TypeError("key must either be a slice or integer")             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 112, __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(12, 112, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":106
 *                 yield item
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

  /* 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.lib.ChunkedArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":114
 *             raise TypeError("key must either be a slice or integer")
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int j
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_12ChunkedArray_getitem(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int64_t __pyx_v_i) {
  int __pyx_v_j;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/table.pxi":117
 *         cdef int j
 * 
 *         index = _normalize_index(i, self.chunked_array.length())             # <<<<<<<<<<<<<<
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_v_self->chunked_array->length()); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(12, 117, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_index = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":118
 * 
 *         index = _normalize_index(i, self.chunked_array.length())
 *         for j in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             if index < self.chunked_array.chunk(j).get().length():
 *                 return self.chunk(j)[index]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(12, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_j = __pyx_t_5;

    /* "pyarrow/table.pxi":119
 *         index = _normalize_index(i, self.chunked_array.length())
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():             # <<<<<<<<<<<<<<
 *                 return self.chunk(j)[index]
 *             else:
 */
    __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->chunk(__pyx_v_j).get()->length()); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_index, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(12, 119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {

      /* "pyarrow/table.pxi":120
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():
 *                 return self.chunk(j)[index]             # <<<<<<<<<<<<<<
 *             else:
 *                 index -= self.chunked_array.chunk(j).get().length()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunk); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "pyarrow/table.pxi":119
 *         index = _normalize_index(i, self.chunked_array.length())
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():             # <<<<<<<<<<<<<<
 *                 return self.chunk(j)[index]
 *             else:
 */
    }

    /* "pyarrow/table.pxi":122
 *                 return self.chunk(j)[index]
 *             else:
 *                 index -= self.chunked_array.chunk(j).get().length()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->chunk(__pyx_v_j).get()->length()); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_v_index, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_6);
      __pyx_t_6 = 0;
    }
  }

  /* "pyarrow/table.pxi":114
 *             raise TypeError("key must either be a slice or integer")
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int j
 * 
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":124
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_24__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_24__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_23__eq__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_23__eq__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/table.pxi":125
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __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/table.pxi":126
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 126, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/table.pxi":125
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __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;

    /* "pyarrow/table.pxi":127
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(12, 127, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/table.pxi":128
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, ChunkedArray other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/table.pxi":125
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":124
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":130
 *             return NotImplemented
 * 
 *     def equals(self, ChunkedArray other):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the contents of two chunked arrays are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_25equals[] = "ChunkedArray.equals(self, ChunkedArray other)\n\n        Return whether the contents of two chunked arrays are equal\n\n        Parameters\n        ----------\n        other : pyarrow.ChunkedArray\n\n        Returns\n        -------\n        are_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_ChunkedArray, 1, "other", 0))) __PYX_ERR(12, 130, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_25equals(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_25equals(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_other) {
   arrow::ChunkedArray *__pyx_v_this_arr;
   arrow::ChunkedArray *__pyx_v_other_arr;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::ChunkedArray *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":143
 *         """
 *         cdef:
 *             CChunkedArray* this_arr = self.chunked_array             # <<<<<<<<<<<<<<
 *             CChunkedArray* other_arr = other.chunked_array
 *             c_bool result
 */
  __pyx_t_1 = __pyx_v_self->chunked_array;
  __pyx_v_this_arr = __pyx_t_1;

  /* "pyarrow/table.pxi":144
 *         cdef:
 *             CChunkedArray* this_arr = self.chunked_array
 *             CChunkedArray* other_arr = other.chunked_array             # <<<<<<<<<<<<<<
 *             c_bool result
 * 
 */
  __pyx_t_1 = __pyx_v_other->chunked_array;
  __pyx_v_other_arr = __pyx_t_1;

  /* "pyarrow/table.pxi":147
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_other) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":148
 * 
 *         if other is None:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":147
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pyarrow/table.pxi":150
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_arr.Equals(deref(other_arr))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":151
 * 
 *         with nogil:
 *             result = this_arr.Equals(deref(other_arr))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result = __pyx_v_this_arr->Equals((*__pyx_v_other_arr));
      }

      /* "pyarrow/table.pxi":150
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_arr.Equals(deref(other_arr))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":153
 *             result = this_arr.Equals(deref(other_arr))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":130
 *             return NotImplemented
 * 
 *     def equals(self, ChunkedArray other):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the contents of two chunked arrays are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":155
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_28_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_27_to_pandas[] = "ChunkedArray._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_28_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(12, 155, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 155, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_27_to_pandas(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_27_to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_out;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_make_tz_aware = 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;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":158
 *         cdef:
 *             PyObject* out
 *             PandasOptions c_options = _convert_pandas_options(options)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_options))||((__pyx_v_options) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_options)->tp_name), 0))) __PYX_ERR(12, 158, __pyx_L1_error)
  __pyx_v_c_options = __pyx_f_7pyarrow_3lib__convert_pandas_options(((PyObject*)__pyx_v_options));

  /* "pyarrow/table.pxi":160
 *             PandasOptions c_options = _convert_pandas_options(options)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_options,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":161
 * 
 *         with nogil:
 *             check_status(libarrow.ConvertChunkedArrayToPandas(             # <<<<<<<<<<<<<<
 *                 c_options,
 *                 self.sp_chunked_array,
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertChunkedArrayToPandas(__pyx_v_c_options, __pyx_v_self->sp_chunked_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 161, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":160
 *             PandasOptions c_options = _convert_pandas_options(options)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_options,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":166
 *                 self, &out))
 * 
 *         result = pandas_api.series(wrap_array_output(out), name=self._name)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_series); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_wrap_array_output(__pyx_v_out); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->_name) < 0) __PYX_ERR(12, 166, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__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;
  __pyx_v_result = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":168
 *         result = pandas_api.series(wrap_array_output(out), name=self._name)
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:             # <<<<<<<<<<<<<<
 *             from pyarrow.pandas_compat import make_tz_aware
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_TypeCheck(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_TimestampType); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tz); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_6) {

    /* "pyarrow/table.pxi":169
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:
 *             from pyarrow.pandas_compat import make_tz_aware             # <<<<<<<<<<<<<<
 * 
 *             result = make_tz_aware(result, self.type.tz)
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_make_tz_aware);
    __Pyx_GIVEREF(__pyx_n_s_make_tz_aware);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_make_tz_aware);
    __pyx_t_5 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_3, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_make_tz_aware); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_make_tz_aware = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":171
 *             from pyarrow.pandas_compat import make_tz_aware
 * 
 *             result = make_tz_aware(result, self.type.tz)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_v_make_tz_aware);
    __pyx_t_3 = __pyx_v_make_tz_aware; __pyx_t_2 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_1 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_result, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 171, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_result, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 171, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_result);
      __Pyx_GIVEREF(__pyx_v_result);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_v_result);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":168
 *         result = pandas_api.series(wrap_array_output(out), name=self._name)
 * 
 *         if isinstance(self.type, TimestampType) and self.type.tz is not None:             # <<<<<<<<<<<<<<
 *             from pyarrow.pandas_compat import make_tz_aware
 * 
 */
  }

  /* "pyarrow/table.pxi":173
 *             result = make_tz_aware(result, self.type.tz)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":155
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_make_tz_aware);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":175
 *         return result
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         values = self.to_pandas().values
 *         if dtype is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_30__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_29__array__[] = "ChunkedArray.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_30__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__array__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__array__") < 0)) __PYX_ERR(12, 175, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dtype = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__array__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 175, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_29__array__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_dtype);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_29__array__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_dtype) {
  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;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__array__", 0);

  /* "pyarrow/table.pxi":176
 * 
 *     def __array__(self, dtype=None):
 *         values = self.to_pandas().values             # <<<<<<<<<<<<<<
 *         if dtype is None:
 *             return values
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_values = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":177
 *     def __array__(self, dtype=None):
 *         values = self.to_pandas().values
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  __pyx_t_4 = (__pyx_v_dtype == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/table.pxi":178
 *         values = self.to_pandas().values
 *         if dtype is None:
 *             return values             # <<<<<<<<<<<<<<
 *         return values.astype(dtype)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_values);
    __pyx_r = __pyx_v_values;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":177
 *     def __array__(self, dtype=None):
 *         values = self.to_pandas().values
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  }

  /* "pyarrow/table.pxi":179
 *         if dtype is None:
 *             return values
 *         return values.astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, object target_type, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 179, __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/table.pxi":175
 *         return result
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         values = self.to_pandas().values
 *         if dtype is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":181
 *         return values.astype(dtype)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to another data type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_32cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_31cast[] = "ChunkedArray.cast(self, target_type, bool safe=True)\n\n        Cast values to another data type\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to cast to\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_32cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target_type = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target_type,&__pyx_n_s_safe,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast") < 0)) __PYX_ERR(12, 181, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target_type = values[0];
    if (values[1]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 181, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 181, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_31cast(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_target_type, __pyx_v_safe);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_31cast(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe) {
   arrow::compute::CastOptions __pyx_v_options;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("cast", 0);

  /* "pyarrow/table.pxi":197
 *         """
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 *             DataType type = ensure_type(target_type)
 *             shared_ptr[CArray] result
 */
  __pyx_v_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/table.pxi":198
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)
 *             DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] result
 *             CDatum out
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":202
 *             CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), CDatum(self.sp_chunked_array),
 *                               type.sp_type, options, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":203
 * 
 *         with nogil:
 *             check_status(Cast(_context(), CDatum(self.sp_chunked_array),             # <<<<<<<<<<<<<<
 *                               type.sp_type, options, &out))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Cast(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_chunked_array), __pyx_v_type->sp_type, __pyx_v_options, (&__pyx_v_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 203, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":202
 *             CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), CDatum(self.sp_chunked_array),
 *                               type.sp_type, options, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":206
 *                               type.sp_type, options, &out))
 * 
 *         return pyarrow_wrap_chunked_array(out.chunked_array())             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_out.chunked_array()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":181
 *         return values.astype(dtype)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to another data type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":208
 *         return pyarrow_wrap_chunked_array(out.chunked_array())
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_34dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_33dictionary_encode[] = "ChunkedArray.dictionary_encode(self)\n\n        Compute dictionary-encoded representation of array\n\n        Returns\n        -------\n        pyarrow.ChunkedArray\n            Same chunking as the input, all chunks share a common dictionary.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_34dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_33dictionary_encode(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_33dictionary_encode(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("dictionary_encode", 0);

  /* "pyarrow/table.pxi":219
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 DictionaryEncode(_context(), CDatum(self.sp_chunked_array),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":220
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 DictionaryEncode(_context(), CDatum(self.sp_chunked_array),
 *                                  &out))
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::DictionaryEncode(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_chunked_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 220, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":219
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 DictionaryEncode(_context(), CDatum(self.sp_chunked_array),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":224
 *                                  &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":208
 *         return pyarrow_wrap_chunked_array(out.chunked_array())
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.dictionary_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":226
 *         return wrap_datum(out)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this ChunkedArray.  If it has a struct type, the column is
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_36flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_35flatten[] = "ChunkedArray.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this ChunkedArray.  If it has a struct type, the column is\n        flattened into one array per struct field.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : List[ChunkedArray]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_36flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(12, 226, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 226, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(12, 226, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_35flatten(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_35flatten(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::ChunkedArray> >  __pyx_v_flattened;
   arrow::MemoryPool *__pyx_v_pool;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_8genexpr8__pyx_v_col;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<std::shared_ptr< arrow::ChunkedArray> > ::iterator __pyx_t_3;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/table.pxi":242
 *         cdef:
 *             vector[shared_ptr[CChunkedArray]] flattened
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":244
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.chunked_array.Flatten(pool, &flattened))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":245
 * 
 *         with nogil:
 *             check_status(self.chunked_array.Flatten(pool, &flattened))             # <<<<<<<<<<<<<<
 * 
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->chunked_array->Flatten(__pyx_v_pool, (&__pyx_v_flattened))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 245, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":244
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.chunked_array.Flatten(pool, &flattened))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":247
 *             check_status(self.chunked_array.Flatten(pool, &flattened))
 * 
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]             # <<<<<<<<<<<<<<
 * 
 *     def unique(self):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_flattened.begin();
    for (;;) {
      if (!(__pyx_t_3 != __pyx_v_flattened.end())) break;
      __pyx_t_4 = *__pyx_t_3;
      ++__pyx_t_3;
      __pyx_8genexpr8__pyx_v_col = __pyx_t_4;
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_8genexpr8__pyx_v_col); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(12, 247, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":226
 *         return wrap_datum(out)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this ChunkedArray.  If it has a struct type, the column is
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":249
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_38unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_37unique[] = "ChunkedArray.unique(self)\n\n        Compute distinct elements in array\n\n        Returns\n        -------\n        pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_38unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unique (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_37unique(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_37unique(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("unique", 0);

  /* "pyarrow/table.pxi":259
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":260
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Unique(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_chunked_array), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 260, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":259
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":263
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":249
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":265
 *         return pyarrow_wrap_array(result)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this ChunkedArray
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_40slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_39slice[] = "ChunkedArray.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this ChunkedArray\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of array to slice\n        length : int, default None\n            Length of slice (default is until end of batch starting from\n            offset)\n\n        Returns\n        -------\n        sliced : ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_40slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(12, 265, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 265, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_39slice(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_39slice(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/table.pxi":283
 *         cdef shared_ptr[CChunkedArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 283, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":284
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 284, __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(12, 284, __pyx_L1_error)

    /* "pyarrow/table.pxi":283
 *         cdef shared_ptr[CChunkedArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":286
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.chunked_array.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":287
 * 
 *         if length is None:
 *             result = self.chunked_array.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.chunked_array.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 287, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":286
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.chunked_array.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":289
 *             result = self.chunked_array.Slice(offset)
 *         else:
 *             result = self.chunked_array.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_chunked_array(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 289, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 289, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":291
 *             result = self.chunked_array.Slice(offset, length)
 * 
 *         return pyarrow_wrap_chunked_array(result)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":265
 *         return pyarrow_wrap_array(result)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this ChunkedArray
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":294
 * 
 *     @property
 *     def num_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of underlying chunks
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10num_chunks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10num_chunks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_10num_chunks___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10num_chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":302
 *         int
 *         """
 *         return self.chunked_array.num_chunks()             # <<<<<<<<<<<<<<
 * 
 *     def chunk(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->chunked_array->num_chunks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":294
 * 
 *     @property
 *     def num_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of underlying chunks
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.num_chunks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":304
 *         return self.chunked_array.num_chunks()
 * 
 *     def chunk(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a chunk by its index
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_42chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_41chunk[] = "ChunkedArray.chunk(self, i)\n\n        Select a chunk by its index\n\n        Parameters\n        ----------\n        i : int\n\n        Returns\n        -------\n        pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_42chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chunk (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_41chunk(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_41chunk(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("chunk", 0);

  /* "pyarrow/table.pxi":316
 *         pyarrow.Array
 *         """
 *         if i >= self.num_chunks or i < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Chunk index out of range.')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(12, 316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 316, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(12, 316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/table.pxi":317
 *         """
 *         if i >= self.num_chunks or i < 0:
 *             raise IndexError('Chunk index out of range.')             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(self.chunked_array.chunk(i))
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 317, __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(12, 317, __pyx_L1_error)

    /* "pyarrow/table.pxi":316
 *         pyarrow.Array
 *         """
 *         if i >= self.num_chunks or i < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Chunk index out of range.')
 * 
 */
  }

  /* "pyarrow/table.pxi":319
 *             raise IndexError('Chunk index out of range.')
 * 
 *         return pyarrow_wrap_array(self.chunked_array.chunk(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 319, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->chunked_array->chunk(__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":304
 *         return self.chunked_array.num_chunks()
 * 
 *     def chunk(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a chunk by its index
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":322
 * 
 *     @property
 *     def chunks(self):             # <<<<<<<<<<<<<<
 *         return list(self.iterchunks())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_6chunks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_6chunks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_6chunks___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":323
 *     @property
 *     def chunks(self):
 *         return list(self.iterchunks())             # <<<<<<<<<<<<<<
 * 
 *     def iterchunks(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iterchunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 323, __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/table.pxi":322
 * 
 *     @property
 *     def chunks(self):             # <<<<<<<<<<<<<<
 *         return list(self.iterchunks())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.chunks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_45generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":325
 *         return list(self.iterchunks())
 * 
 *     def iterchunks(self):             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_44iterchunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_43iterchunks[] = "ChunkedArray.iterchunks(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_44iterchunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterchunks (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_43iterchunks(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_43iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterchunks", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_iterchunks(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_iterchunks, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(12, 325, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_12ChunkedArray_45generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterchunks, __pyx_n_s_ChunkedArray_iterchunks, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(12, 325, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.iterchunks", __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_3lib_12ChunkedArray_45generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterchunks", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(12, 325, __pyx_L1_error)

  /* "pyarrow/table.pxi":326
 * 
 *     def iterchunks(self):
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             yield self.chunk(i)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 326, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(12, 326, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(12, 326, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 326, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":327
 *     def iterchunks(self):
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)             # <<<<<<<<<<<<<<
 * 
 *     def to_pylist(self):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_chunk); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(12, 327, __pyx_L1_error)

    /* "pyarrow/table.pxi":326
 * 
 *     def iterchunks(self):
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             yield self.chunk(i)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/table.pxi":325
 *         return list(self.iterchunks())
 * 
 *     def iterchunks(self):             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iterchunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":329
 *             yield self.chunk(i)
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_47to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_46to_pylist[] = "ChunkedArray.to_pylist(self)\n\n        Convert to a list of native Python objects.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_47to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pylist (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_46to_pylist(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_46to_pylist(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_i = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("to_pylist", 0);

  /* "pyarrow/table.pxi":333
 *         Convert to a list of native Python objects.
 *         """
 *         result = []             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             result += self.chunk(i).to_pylist()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":334
 *         """
 *         result = []
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             result += self.chunk(i).to_pylist()
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 334, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(12, 334, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 334, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(12, 334, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 334, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 334, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":335
 *         result = []
 *         for i in range(self.num_chunks):
 *             result += self.chunk(i).to_pylist()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunk); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":334
 *         """
 *         result = []
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             result += self.chunk(i).to_pylist()
 *         return result
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":336
 *         for i in range(self.num_chunks):
 *             result += self.chunk(i).to_pylist()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":329
 *             yield self.chunk(i)
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.to_pylist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":399
 *     cdef readonly:
 *         # To allow Table to propagate metadata to pandas.Series
 *         object _name             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_5_name___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_5_name___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_name);
  __pyx_r = __pyx_v_self->_name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":339
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_137chunked_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_136chunked_array[] = "chunked_array(arrays, type=None)\n\n    Construct chunked array from list of array-like objects\n\n    Parameters\n    ----------\n    arrays : Array, list of Array, or values coercible to arrays\n        Must all be the same data type. Can be empty only if type also\n        passed\n    type : DataType or string coercible to DataType\n\n    Returns\n    -------\n    ChunkedArray\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_137chunked_array = {"chunked_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_137chunked_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_136chunked_array};
static PyObject *__pyx_pw_7pyarrow_3lib_137chunked_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chunked_array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chunked_array") < 0)) __PYX_ERR(12, 339, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chunked_array", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 339, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.chunked_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_136chunked_array(__pyx_self, __pyx_v_arrays, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_136chunked_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_type) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_sp_chunked_array;
  std::shared_ptr< arrow::DataType>  __pyx_v_sp_data_type;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("chunked_array", 0);
  __Pyx_INCREF(__pyx_v_arrays);

  /* "pyarrow/table.pxi":360
 *         shared_ptr[CDataType] sp_data_type
 * 
 *     if isinstance(arrays, Array):             # <<<<<<<<<<<<<<
 *         arrays = [arrays]
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_arrays, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":361
 * 
 *     if isinstance(arrays, Array):
 *         arrays = [arrays]             # <<<<<<<<<<<<<<
 * 
 *     for x in arrays:
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_arrays);
    __Pyx_DECREF_SET(__pyx_v_arrays, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":360
 *         shared_ptr[CDataType] sp_data_type
 * 
 *     if isinstance(arrays, Array):             # <<<<<<<<<<<<<<
 *         arrays = [arrays]
 * 
 */
  }

  /* "pyarrow/table.pxi":363
 *         arrays = [arrays]
 * 
 *     for x in arrays:             # <<<<<<<<<<<<<<
 *         if isinstance(x, Array):
 *             arr = x
 */
  if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
    __pyx_t_3 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 363, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 363, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 363, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 363, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 363, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 363, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":364
 * 
 *     for x in arrays:
 *         if isinstance(x, Array):             # <<<<<<<<<<<<<<
 *             arr = x
 *             if type is not None:
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_x, __pyx_ptype_7pyarrow_3lib_Array); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/table.pxi":365
 *     for x in arrays:
 *         if isinstance(x, Array):
 *             arr = x             # <<<<<<<<<<<<<<
 *             if type is not None:
 *                 assert x.type == type
 */
      if (!(likely(((__pyx_v_x) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(12, 365, __pyx_L1_error)
      __pyx_t_6 = __pyx_v_x;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "pyarrow/table.pxi":366
 *         if isinstance(x, Array):
 *             arr = x
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 assert x.type == type
 *         else:
 */
      __pyx_t_1 = (__pyx_v_type != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/table.pxi":367
 *             arr = x
 *             if type is not None:
 *                 assert x.type == type             # <<<<<<<<<<<<<<
 *         else:
 *             arr = array(x, type=type)
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(!Py_OptimizeFlag)) {
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 367, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_v_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 367, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 367, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) {
            PyErr_SetNone(PyExc_AssertionError);
            __PYX_ERR(12, 367, __pyx_L1_error)
          }
        }
        #endif

        /* "pyarrow/table.pxi":366
 *         if isinstance(x, Array):
 *             arr = x
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 assert x.type == type
 *         else:
 */
      }

      /* "pyarrow/table.pxi":364
 * 
 *     for x in arrays:
 *         if isinstance(x, Array):             # <<<<<<<<<<<<<<
 *             arr = x
 *             if type is not None:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/table.pxi":369
 *                 assert x.type == type
 *         else:
 *             arr = array(x, type=type)             # <<<<<<<<<<<<<<
 * 
 *         c_arrays.push_back(arr.sp_array)
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(12, 369, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(12, 369, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_9));
      __pyx_t_9 = 0;
    }
    __pyx_L6:;

    /* "pyarrow/table.pxi":371
 *             arr = array(x, type=type)
 * 
 *         c_arrays.push_back(arr.sp_array)             # <<<<<<<<<<<<<<
 * 
 *     if type:
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_v_arr->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(12, 371, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":363
 *         arrays = [arrays]
 * 
 *     for x in arrays:             # <<<<<<<<<<<<<<
 *         if isinstance(x, Array):
 *             arr = x
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":373
 *         c_arrays.push_back(arr.sp_array)
 * 
 *     if type:             # <<<<<<<<<<<<<<
 *         sp_data_type = pyarrow_unwrap_data_type(type)
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 373, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":374
 * 
 *     if type:
 *         sp_data_type = pyarrow_unwrap_data_type(type)             # <<<<<<<<<<<<<<
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 *     else:
 */
    __pyx_v_sp_data_type = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type(__pyx_v_type);

    /* "pyarrow/table.pxi":375
 *     if type:
 *         sp_data_type = pyarrow_unwrap_data_type(type)
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))             # <<<<<<<<<<<<<<
 *     else:
 *         if c_arrays.size() == 0:
 */
    __pyx_v_sp_chunked_array.reset(new  arrow::ChunkedArray(__pyx_v_c_arrays, __pyx_v_sp_data_type));

    /* "pyarrow/table.pxi":373
 *         c_arrays.push_back(arr.sp_array)
 * 
 *     if type:             # <<<<<<<<<<<<<<
 *         sp_data_type = pyarrow_unwrap_data_type(type)
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 */
    goto __pyx_L8;
  }

  /* "pyarrow/table.pxi":377
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 *     else:
 *         if c_arrays.size() == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot construct a chunked array with neither "
 *                              "arrays nor type")
 */
  /*else*/ {
    __pyx_t_2 = ((__pyx_v_c_arrays.size() == 0) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":378
 *     else:
 *         if c_arrays.size() == 0:
 *             raise ValueError("Cannot construct a chunked array with neither "             # <<<<<<<<<<<<<<
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 378, __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(12, 378, __pyx_L1_error)

      /* "pyarrow/table.pxi":377
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 *     else:
 *         if c_arrays.size() == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot construct a chunked array with neither "
 *                              "arrays nor type")
 */
    }

    /* "pyarrow/table.pxi":380
 *             raise ValueError("Cannot construct a chunked array with neither "
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __pyx_v_sp_chunked_array.reset(new  arrow::ChunkedArray(__pyx_v_c_arrays));
  }
  __pyx_L8:;

  /* "pyarrow/table.pxi":382
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(sp_chunked_array.get().Validate())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":383
 * 
 *     with nogil:
 *         check_status(sp_chunked_array.get().Validate())             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_chunked_array(sp_chunked_array)
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_sp_chunked_array.get()->Validate()); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(12, 383, __pyx_L11_error)
      }

      /* "pyarrow/table.pxi":382
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(sp_chunked_array.get().Validate())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L12;
        }
        __pyx_L11_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pyarrow/table.pxi":385
 *         check_status(sp_chunked_array.get().Validate())
 * 
 *     return pyarrow_wrap_chunked_array(sp_chunked_array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_sp_chunked_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":339
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.chunked_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":388
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t K = len(arrays)
 */

static PyObject *__pyx_f_7pyarrow_3lib__schema_from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_metadata, std::shared_ptr< arrow::Schema>  *__pyx_v_schema) {
  Py_ssize_t __pyx_v_K;
  std::string __pyx_v_c_name;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  PyObject *__pyx_v_converted_arrays = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  std::shared_ptr< arrow::DataType>  __pyx_t_14;
  std::string __pyx_t_15;
  int __pyx_t_16;
  __Pyx_RefNannySetupContext("_schema_from_arrays", 0);

  /* "pyarrow/table.pxi":390
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):
 *     cdef:
 *         Py_ssize_t K = len(arrays)             # <<<<<<<<<<<<<<
 *         c_string c_name
 *         shared_ptr[CDataType] c_type
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 390, __pyx_L1_error)
  __pyx_v_K = __pyx_t_1;

  /* "pyarrow/table.pxi":396
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_2 = (__pyx_v_metadata != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":397
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":398
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 398, __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(12, 398, __pyx_L1_error)

      /* "pyarrow/table.pxi":397
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":399
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     if K == 0:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":396
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":401
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return arrays
 */
  __pyx_t_2 = ((__pyx_v_K == 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":402
 * 
 *     if K == 0:
 *         schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *         return arrays
 * 
 */
    __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

    /* "pyarrow/table.pxi":403
 *     if K == 0:
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return arrays             # <<<<<<<<<<<<<<
 * 
 *     c_fields.resize(K)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_arrays);
    __pyx_r = __pyx_v_arrays;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":401
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return arrays
 */
  }

  /* "pyarrow/table.pxi":405
 *         return arrays
 * 
 *     c_fields.resize(K)             # <<<<<<<<<<<<<<
 * 
 *     if names is None:
 */
  try {
    __pyx_v_c_fields.resize(__pyx_v_K);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(12, 405, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":407
 *     c_fields.resize(K)
 * 
 *     if names is None:             # <<<<<<<<<<<<<<
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 */
  __pyx_t_2 = (__pyx_v_names == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/table.pxi":408
 * 
 *     if names is None:
 *         raise ValueError('Must pass names or schema to Table.from_arrays')             # <<<<<<<<<<<<<<
 * 
 *     if len(names) != K:
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 408, __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(12, 408, __pyx_L1_error)

    /* "pyarrow/table.pxi":407
 *     c_fields.resize(K)
 * 
 *     if names is None:             # <<<<<<<<<<<<<<
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 */
  }

  /* "pyarrow/table.pxi":410
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 *     if len(names) != K:             # <<<<<<<<<<<<<<
 *         raise ValueError('Length of names ({}) does not match '
 *                          'length of arrays ({})'.format(len(names), K))
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 410, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_v_K) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/table.pxi":412
 *     if len(names) != K:
 *         raise ValueError('Length of names ({}) does not match '
 *                          'length of arrays ({})'.format(len(names), K))             # <<<<<<<<<<<<<<
 * 
 *     converted_arrays = []
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Length_of_names_does_not_match_l, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 412, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 412, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 412, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":411
 * 
 *     if len(names) != K:
 *         raise ValueError('Length of names ({}) does not match '             # <<<<<<<<<<<<<<
 *                          'length of arrays ({})'.format(len(names), K))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(12, 411, __pyx_L1_error)

    /* "pyarrow/table.pxi":410
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 *     if len(names) != K:             # <<<<<<<<<<<<<<
 *         raise ValueError('Length of names ({}) does not match '
 *                          'length of arrays ({})'.format(len(names), K))
 */
  }

  /* "pyarrow/table.pxi":414
 *                          'length of arrays ({})'.format(len(names), K))
 * 
 *     converted_arrays = []             # <<<<<<<<<<<<<<
 *     for i in range(K):
 *         val = arrays[i]
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_converted_arrays = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":415
 * 
 *     converted_arrays = []
 *     for i in range(K):             # <<<<<<<<<<<<<<
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):
 */
  __pyx_t_1 = __pyx_v_K;
  __pyx_t_11 = __pyx_t_1;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pyarrow/table.pxi":416
 *     converted_arrays = []
 *     for i in range(K):
 *         val = arrays[i]             # <<<<<<<<<<<<<<
 *         if not isinstance(val, (Array, ChunkedArray)):
 *             val = array(val)
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":417
 *     for i in range(K):
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *             val = array(val)
 * 
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_Array); 
    __pyx_t_13 = (__pyx_t_2 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_3 = __pyx_t_13;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_13 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
    __pyx_t_2 = (__pyx_t_13 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L11_bool_binop_done:;
    __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/table.pxi":418
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):
 *             val = array(val)             # <<<<<<<<<<<<<<
 * 
 *         c_type = (<DataType> val.type).sp_type
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_val);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pyarrow/table.pxi":417
 *     for i in range(K):
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *             val = array(val)
 * 
 */
    }

    /* "pyarrow/table.pxi":420
 *             val = array(val)
 * 
 *         c_type = (<DataType> val.type).sp_type             # <<<<<<<<<<<<<<
 * 
 *         if names[i] is None:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_14 = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_5)->sp_type;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_c_type = __pyx_t_14;

    /* "pyarrow/table.pxi":422
 *         c_type = (<DataType> val.type).sp_type
 * 
 *         if names[i] is None:             # <<<<<<<<<<<<<<
 *             c_name = tobytes(u'None')
 *         else:
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = (__pyx_t_5 == Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/table.pxi":423
 * 
 *         if names[i] is None:
 *             c_name = tobytes(u'None')             # <<<<<<<<<<<<<<
 *         else:
 *             c_name = tobytes(names[i])
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 423, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_n_u_None) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_None);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 423, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_15 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 423, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_c_name = __pyx_t_15;

      /* "pyarrow/table.pxi":422
 *         c_type = (<DataType> val.type).sp_type
 * 
 *         if names[i] is None:             # <<<<<<<<<<<<<<
 *             c_name = tobytes(u'None')
 *         else:
 */
      goto __pyx_L13;
    }

    /* "pyarrow/table.pxi":425
 *             c_name = tobytes(u'None')
 *         else:
 *             c_name = tobytes(names[i])             # <<<<<<<<<<<<<<
 *         c_fields[i].reset(new CField(c_name, c_type, True))
 *         converted_arrays.append(val)
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10);
      __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(12, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_15 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 425, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_c_name = __pyx_t_15;
    }
    __pyx_L13:;

    /* "pyarrow/table.pxi":426
 *         else:
 *             c_name = tobytes(names[i])
 *         c_fields[i].reset(new CField(c_name, c_type, True))             # <<<<<<<<<<<<<<
 *         converted_arrays.append(val)
 * 
 */
    (__pyx_v_c_fields[__pyx_v_i]).reset(new  arrow::Field(__pyx_v_c_name, __pyx_v_c_type, 1));

    /* "pyarrow/table.pxi":427
 *             c_name = tobytes(names[i])
 *         c_fields[i].reset(new CField(c_name, c_type, True))
 *         converted_arrays.append(val)             # <<<<<<<<<<<<<<
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))
 */
    __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_converted_arrays, __pyx_v_val); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(12, 427, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":429
 *         converted_arrays.append(val)
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *     return converted_arrays
 * 
 */
  __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

  /* "pyarrow/table.pxi":430
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))
 *     return converted_arrays             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_converted_arrays);
  __pyx_r = __pyx_v_converted_arrays;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":388
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t K = len(arrays)
 */

  /* 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_10);
  __Pyx_AddTraceback("pyarrow.lib._schema_from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":433
 * 
 * 
 * cdef _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 */

static PyObject *__pyx_f_7pyarrow_3lib__sanitize_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata, std::shared_ptr< arrow::Schema>  *__pyx_v_c_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_cy_schema = 0;
  PyObject *__pyx_v_converted_arrays = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  std::shared_ptr< arrow::Schema>  __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("_sanitize_arrays", 0);

  /* "pyarrow/table.pxi":436
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 *     if schema is None:             # <<<<<<<<<<<<<<
 *         converted_arrays = _schema_from_arrays(arrays, names, metadata,
 *                                                c_schema)
 */
  __pyx_t_1 = (__pyx_v_schema == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":437
 *     cdef Schema cy_schema
 *     if schema is None:
 *         converted_arrays = _schema_from_arrays(arrays, names, metadata,             # <<<<<<<<<<<<<<
 *                                                c_schema)
 *     else:
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib__schema_from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_metadata, __pyx_v_c_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_converted_arrays = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":436
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 *     if schema is None:             # <<<<<<<<<<<<<<
 *         converted_arrays = _schema_from_arrays(arrays, names, metadata,
 *                                                c_schema)
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":440
 *                                                c_schema)
 *     else:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_names != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":441
 *     else:
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')             # <<<<<<<<<<<<<<
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 441, __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(12, 441, __pyx_L1_error)

      /* "pyarrow/table.pxi":440
 *                                                c_schema)
 *     else:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 */
    }

    /* "pyarrow/table.pxi":442
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and metadata')
 *         cy_schema = schema
 */
    __pyx_t_1 = (__pyx_v_metadata != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":443
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')             # <<<<<<<<<<<<<<
 *         cy_schema = schema
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 443, __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(12, 443, __pyx_L1_error)

      /* "pyarrow/table.pxi":442
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and metadata')
 *         cy_schema = schema
 */
    }

    /* "pyarrow/table.pxi":444
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')
 *         cy_schema = schema             # <<<<<<<<<<<<<<
 * 
 *         if len(schema) != len(arrays):
 */
    if (!(likely(((__pyx_v_schema) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_schema, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(12, 444, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_schema;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_cy_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":446
 *         cy_schema = schema
 * 
 *         if len(schema) != len(arrays):             # <<<<<<<<<<<<<<
 *             raise ValueError('Schema and number of arrays unequal')
 * 
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_schema); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(12, 446, __pyx_L1_error)
    __pyx_t_5 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(12, 446, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_4 != __pyx_t_5) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":447
 * 
 *         if len(schema) != len(arrays):
 *             raise ValueError('Schema and number of arrays unequal')             # <<<<<<<<<<<<<<
 * 
 *         c_schema[0] = cy_schema.sp_schema
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 447, __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(12, 447, __pyx_L1_error)

      /* "pyarrow/table.pxi":446
 *         cy_schema = schema
 * 
 *         if len(schema) != len(arrays):             # <<<<<<<<<<<<<<
 *             raise ValueError('Schema and number of arrays unequal')
 * 
 */
    }

    /* "pyarrow/table.pxi":449
 *             raise ValueError('Schema and number of arrays unequal')
 * 
 *         c_schema[0] = cy_schema.sp_schema             # <<<<<<<<<<<<<<
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):
 */
    __pyx_t_6 = __pyx_v_cy_schema->sp_schema;
    (__pyx_v_c_schema[0]) = __pyx_t_6;

    /* "pyarrow/table.pxi":450
 * 
 *         c_schema[0] = cy_schema.sp_schema
 *         converted_arrays = []             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(arrays):
 *             item = asarray(item, type=schema[i].type)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_converted_arrays = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":451
 *         c_schema[0] = cy_schema.sp_schema
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):             # <<<<<<<<<<<<<<
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
      __pyx_t_7 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 451, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(12, 451, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(12, 451, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_8(__pyx_t_7);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 451, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "pyarrow/table.pxi":452
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):
 *             item = asarray(item, type=schema[i].type)             # <<<<<<<<<<<<<<
 *             converted_arrays.append(item)
 *     return converted_arrays
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_item);
      __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_schema, __pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_type); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_type, __pyx_t_13) < 0) __PYX_ERR(12, 452, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_13);
      __pyx_t_13 = 0;

      /* "pyarrow/table.pxi":453
 *         for i, item in enumerate(arrays):
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)             # <<<<<<<<<<<<<<
 *     return converted_arrays
 * 
 */
      __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_converted_arrays, __pyx_v_item); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(12, 453, __pyx_L1_error)

      /* "pyarrow/table.pxi":451
 *         c_schema[0] = cy_schema.sp_schema
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):             # <<<<<<<<<<<<<<
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":454
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)
 *     return converted_arrays             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_converted_arrays);
  __pyx_r = __pyx_v_converted_arrays;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":433
 * 
 * 
 * cdef _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib._sanitize_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cy_schema);
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":467
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.batch = NULL
 *         self._schema = None
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch___cinit__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11RecordBatch___cinit__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/table.pxi":468
 * 
 *     def __cinit__(self):
 *         self.batch = NULL             # <<<<<<<<<<<<<<
 *         self._schema = None
 * 
 */
  __pyx_v_self->batch = NULL;

  /* "pyarrow/table.pxi":469
 *     def __cinit__(self):
 *         self.batch = NULL
 *         self._schema = None             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_schema);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_schema));
  __pyx_v_self->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);

  /* "pyarrow/table.pxi":467
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.batch = NULL
 *         self._schema = None
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":471
 *         self._schema = None
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "
 *                         "one of the `RecordBatch.from_*` functions instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_2__init__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11RecordBatch_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/table.pxi":472
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 472, __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(12, 472, __pyx_L1_error)

  /* "pyarrow/table.pxi":471
 *         self._schema = None
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "
 *                         "one of the `RecordBatch.from_*` functions instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":475
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):             # <<<<<<<<<<<<<<
 *         self.sp_batch = batch
 *         self.batch = batch.get()
 */

static void __pyx_f_7pyarrow_3lib_11RecordBatch_init(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, std::shared_ptr< arrow::RecordBatch>  const &__pyx_v_batch) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/table.pxi":476
 * 
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):
 *         self.sp_batch = batch             # <<<<<<<<<<<<<<
 *         self.batch = batch.get()
 * 
 */
  __pyx_v_self->sp_batch = __pyx_v_batch;

  /* "pyarrow/table.pxi":477
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):
 *         self.sp_batch = batch
 *         self.batch = batch.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->batch = __pyx_v_batch.get();

  /* "pyarrow/table.pxi":475
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):             # <<<<<<<<<<<<<<
 *         self.sp_batch = batch
 *         self.batch = batch.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/table.pxi":479
 *         self.batch = batch.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_4__reduce__[] = "RecordBatch.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_4__reduce__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_4__reduce__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/table.pxi":480
 * 
 *     def __reduce__(self):
 *         return _reconstruct_record_batch, (self.columns, self.schema)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_reconstruct_record_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":479
 *         self.batch = batch.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 */

  /* 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.lib.RecordBatch.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":482
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.batch.num_rows()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_6__len__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_11RecordBatch_6__len__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/table.pxi":483
 * 
 *     def __len__(self):
 *         return self.batch.num_rows()             # <<<<<<<<<<<<<<
 * 
 *     def validate(self):
 */
  __pyx_r = __pyx_v_self->batch->num_rows();
  goto __pyx_L0;

  /* "pyarrow/table.pxi":482
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.batch.num_rows()
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":485
 *         return self.batch.num_rows()
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate RecordBatch consistency.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_9validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_8validate[] = "RecordBatch.validate(self)\n\n        Validate RecordBatch consistency.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_9validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_8validate(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8validate(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/table.pxi":489
 *         Validate RecordBatch consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.batch.Validate())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":490
 *         """
 *         with nogil:
 *             check_status(self.batch.Validate())             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, metadata=None):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->batch->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 490, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":489
 *         Validate RecordBatch consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.batch.Validate())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":485
 *         return self.batch.num_rows()
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate RecordBatch consistency.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":492
 *             check_status(self.batch.Validate())
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata[] = "RecordBatch.replace_schema_metadata(self, metadata=None)\n\n        EXPERIMENTAL: Create shallow copy of record batch by replacing schema\n        key-value metadata with the indicated new metadata (which may be None,\n        which deletes any existing metadata\n\n        Parameters\n        ----------\n        metadata : dict, default None\n\n        Returns\n        -------\n        shallow_copy : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace_schema_metadata (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metadata,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace_schema_metadata") < 0)) __PYX_ERR(12, 492, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_metadata = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace_schema_metadata", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 492, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_c_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":510
 *             shared_ptr[CRecordBatch] c_batch
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_1 = (__pyx_v_metadata != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":511
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_2 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":512
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 512, __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(12, 512, __pyx_L1_error)

      /* "pyarrow/table.pxi":511
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":513
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":510
 *             shared_ptr[CRecordBatch] c_batch
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":515
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":516
 * 
 *         with nogil:
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(c_batch)
 */
        __pyx_v_c_batch = __pyx_v_self->batch->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":515
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":518
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_batch(c_batch)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_c_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":492
 *             check_status(self.batch.Validate())
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":521
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11num_columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11num_columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_11num_columns___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":529
 *         int
 *         """
 *         return self.batch.num_columns()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->batch->num_columns()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":521
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.num_columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":532
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":543
 *         int
 *         """
 *         return len(self)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 543, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":532
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":546
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the RecordBatch and its columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_6schema___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_6schema___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":554
 *         pyarrow.Schema
 *         """
 *         if self._schema is None:             # <<<<<<<<<<<<<<
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_schema) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":555
 *         """
 *         if self._schema is None:
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())             # <<<<<<<<<<<<<<
 * 
 *         return self._schema
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->batch->schema()); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(12, 555, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_schema);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->_schema));
    __pyx_v_self->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":554
 *         pyarrow.Schema
 *         """
 *         if self._schema is None:             # <<<<<<<<<<<<<<
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 */
  }

  /* "pyarrow/table.pxi":557
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 *         return self._schema             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_schema));
  __pyx_r = ((PyObject *)__pyx_v_self->_schema);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":546
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the RecordBatch and its columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":560
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_8genexpr9__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":568
 *         list of pa.ChunkedArray
 *         """
 *         return [self.column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     def column(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 568, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 568, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 568, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 568, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 568, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 568, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 568, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 568, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 568, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 568, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 568, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr9__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr9__pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 568, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(12, 568, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i); __pyx_8genexpr9__pyx_v_i = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i); __pyx_8genexpr9__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":560
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":570
 *         return [self.column(i) for i in range(self.num_columns)]
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select single column from record batch
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_13column(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_12column[] = "RecordBatch.column(self, i)\n\n        Select single column from record batch\n\n        Returns\n        -------\n        column : pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_13column(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("column (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_12column(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_12column(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_i) {
  int __pyx_v_index;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("column", 0);

  /* "pyarrow/table.pxi":578
 *         column : pyarrow.Array
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))
 *         result._name = self.schema[index].name
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 578, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1L))) __PYX_ERR(12, 578, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_4);

  /* "pyarrow/table.pxi":579
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))             # <<<<<<<<<<<<<<
 *         result._name = self.schema[index].name
 *         return result
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->batch->column(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(12, 579, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":580
 *         cdef int index = <int> _normalize_index(i, self.num_columns)
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))
 *         result._name = self.schema[index].name             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->_name);
  __Pyx_DECREF(__pyx_v_result->_name);
  __pyx_v_result->_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":581
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))
 *         result._name = self.schema[index].name
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":570
 *         return [self.column(i) for i in range(self.num_columns)]
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select single column from record batch
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.column", __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/table.pxi":583
 *         return result
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_14__getitem__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_14__getitem__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":584
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":585
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.column(key)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 585, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 585, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_key);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":584
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":587
 *             return _normalize_slice(self, key)
 *         else:
 *             return self.column(key)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, memory_pool=None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":583
 *         return result
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

  /* 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.lib.RecordBatch.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":589
 *             return self.column(key)
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to Buffer as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_17serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_16serialize[] = "RecordBatch.serialize(self, memory_pool=None)\n\n        Write RecordBatch to Buffer as encapsulated IPC message\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n\n        Returns\n        -------\n        serialized : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_17serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(12, 589, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 589, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_16serialize(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_16serialize(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buffer;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/table.pxi":604
 *         cdef:
 *             shared_ptr[CBuffer] buffer
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(((__pyx_v_memory_pool) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_memory_pool, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(12, 604, __pyx_L1_error)
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_memory_pool));

  /* "pyarrow/table.pxi":606
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeRecordBatch(deref(self.batch),
 *                                               pool, &buffer))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":607
 * 
 *         with nogil:
 *             check_status(SerializeRecordBatch(deref(self.batch),             # <<<<<<<<<<<<<<
 *                                               pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::SerializeRecordBatch((*__pyx_v_self->batch), __pyx_v_pool, (&__pyx_v_buffer))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 607, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":606
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeRecordBatch(deref(self.batch),
 *                                               pool, &buffer))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":609
 *             check_status(SerializeRecordBatch(deref(self.batch),
 *                                               pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":589
 *             return self.column(key)
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to Buffer as encapsulated IPC message
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":611
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this RecordBatch
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_19slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_18slice[] = "RecordBatch.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this RecordBatch\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of record batch to slice\n        length : int, default None\n            Length of slice (default is until end of batch starting from\n            offset)\n\n        Returns\n        -------\n        sliced : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_19slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(12, 611, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 611, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_18slice(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_18slice(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/table.pxi":629
 *         cdef shared_ptr[CRecordBatch] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 629, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":630
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 630, __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(12, 630, __pyx_L1_error)

    /* "pyarrow/table.pxi":629
 *         cdef shared_ptr[CRecordBatch] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":632
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.batch.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":633
 * 
 *         if length is None:
 *             result = self.batch.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.batch.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 633, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":632
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.batch.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":635
 *             result = self.batch.Slice(offset)
 *         else:
 *             result = self.batch.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 635, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 635, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":637
 *             result = self.batch.Slice(offset, length)
 * 
 *         return pyarrow_wrap_batch(result)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, RecordBatch other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":611
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this RecordBatch
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":639
 *         return pyarrow_wrap_batch(result)
 * 
 *     def equals(self, RecordBatch other):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CRecordBatch* this_batch = self.batch
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_21equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_20equals[] = "RecordBatch.equals(self, RecordBatch other)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_21equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "other", 0))) __PYX_ERR(12, 639, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_20equals(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_20equals(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_other) {
   arrow::RecordBatch *__pyx_v_this_batch;
   arrow::RecordBatch *__pyx_v_other_batch;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::RecordBatch *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":641
 *     def equals(self, RecordBatch other):
 *         cdef:
 *             CRecordBatch* this_batch = self.batch             # <<<<<<<<<<<<<<
 *             CRecordBatch* other_batch = other.batch
 *             c_bool result
 */
  __pyx_t_1 = __pyx_v_self->batch;
  __pyx_v_this_batch = __pyx_t_1;

  /* "pyarrow/table.pxi":642
 *         cdef:
 *             CRecordBatch* this_batch = self.batch
 *             CRecordBatch* other_batch = other.batch             # <<<<<<<<<<<<<<
 *             c_bool result
 * 
 */
  __pyx_t_1 = __pyx_v_other->batch;
  __pyx_v_other_batch = __pyx_t_1;

  /* "pyarrow/table.pxi":645
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_batch.Equals(deref(other_batch))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":646
 * 
 *         with nogil:
 *             result = this_batch.Equals(deref(other_batch))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result = __pyx_v_this_batch->Equals((*__pyx_v_other_batch));
      }

      /* "pyarrow/table.pxi":645
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_batch.Equals(deref(other_batch))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":648
 *             result = this_batch.Equals(deref(other_batch))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_pydict(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":639
 *         return pyarrow_wrap_batch(result)
 * 
 *     def equals(self, RecordBatch other):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CRecordBatch* this_batch = self.batch
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":650
 *         return result
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the RecordBatch to a dict or OrderedDict.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_22to_pydict[] = "RecordBatch.to_pydict(self)\n\n        Convert the RecordBatch to a dict or OrderedDict.\n\n        Returns\n        -------\n        dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pydict (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_22to_pydict(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_22to_pydict(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_v_entries = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_column = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("to_pydict", 0);

  /* "pyarrow/table.pxi":658
 *         dict
 *         """
 *         entries = []             # <<<<<<<<<<<<<<
 *         for i in range(self.batch.num_columns()):
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":659
 *         """
 *         entries = []
 *         for i in range(self.batch.num_columns()):             # <<<<<<<<<<<<<<
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 *             column = self[i].to_pylist()
 */
  __pyx_t_2 = __pyx_v_self->batch->num_columns();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/table.pxi":660
 *         entries = []
 *         for i in range(self.batch.num_columns()):
 *             name = bytes(self.batch.column_name(i)).decode('utf8')             # <<<<<<<<<<<<<<
 *             column = self[i].to_pylist()
 *             entries.append((name, column))
 */
    __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->batch->column_name(__pyx_v_i)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_decode_bytes(__pyx_t_5, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":661
 *         for i in range(self.batch.num_columns()):
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 *             column = self[i].to_pylist()             # <<<<<<<<<<<<<<
 *             entries.append((name, column))
 *         return ordered_dict(entries)
 */
    __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_column, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":662
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 *             column = self[i].to_pylist()
 *             entries.append((name, column))             # <<<<<<<<<<<<<<
 *         return ordered_dict(entries)
 * 
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_column);
    __Pyx_GIVEREF(__pyx_v_column);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_column);
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(12, 662, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/table.pxi":663
 *             column = self[i].to_pylist()
 *             entries.append((name, column))
 *         return ordered_dict(entries)             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_entries) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_entries);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":650
 *         return result
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the RecordBatch to a dict or OrderedDict.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.to_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_entries);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":665
 *         return ordered_dict(entries)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_25_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_24_to_pandas[] = "RecordBatch._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_25_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(12, 665, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 665, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_24_to_pandas(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_24_to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_options, 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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":666
 * 
 *     def _to_pandas(self, options, **kwargs):
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_batches); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(12, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 666, __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/table.pxi":665
 *         return ordered_dict(entries)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 */

  /* 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.lib.RecordBatch._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":669
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_27from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_26from_pandas[] = "RecordBatch.from_pandas(type cls, df, Schema schema=None, preserve_index=None, nthreads=None, columns=None)\n\n        Convert pandas.DataFrame to an Arrow RecordBatch\n\n        Parameters\n        ----------\n        df: pandas.DataFrame\n        schema: pyarrow.Schema, optional\n            The expected schema of the RecordBatch. This can be used to\n            indicate the type of columns if we cannot infer it automatically.\n            If passed, the output will have exactly this schema. Columns\n            specified in the schema that are not found in the DataFrame columns\n            or its index will raise an error. Additional columns or index\n            levels in the DataFrame which are not specified in the schema will\n            be ignored.\n        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``RecordBatch``. The default of None will store the index as a\n            column, except for RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n        nthreads : int, default None (may use up to system CPU count threads)\n            If greater than 1, convert columns to Arrow in parallel using\n            indicated number of threads\n        columns : list, optional\n           List of column to be converted. If None, use all columns.\n\n        Returns\n        -------\n        pyarrow.RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_27from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_preserve_index = 0;
  PyObject *__pyx_v_nthreads = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_schema,&__pyx_n_s_preserve_index,&__pyx_n_s_nthreads,&__pyx_n_s_columns,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/table.pxi":670
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.DataFrame to an Arrow RecordBatch
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_index);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(12, 669, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_preserve_index = values[2];
    __pyx_v_nthreads = values[3];
    __pyx_v_columns = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 669, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(12, 669, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_26from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_schema, __pyx_v_preserve_index, __pyx_v_nthreads, __pyx_v_columns);

  /* "pyarrow/table.pxi":669
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_26from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns) {
  PyObject *__pyx_v_dataframe_to_arrays = NULL;
  PyObject *__pyx_v_arrays = 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)(PyObject *);
  __Pyx_RefNannySetupContext("from_pandas", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_schema);

  /* "pyarrow/table.pxi":700
 *         pyarrow.RecordBatch
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays             # <<<<<<<<<<<<<<
 *         arrays, schema = dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_arrays);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_arrays);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_arrays);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_arrays = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":701
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);
  __Pyx_INCREF(((PyObject *)__pyx_v_schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_schema));
  __Pyx_INCREF(__pyx_v_preserve_index);
  __Pyx_GIVEREF(__pyx_v_preserve_index);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_preserve_index);

  /* "pyarrow/table.pxi":702
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, schema=schema)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(12, 702, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(12, 702, __pyx_L1_error)

  /* "pyarrow/table.pxi":701
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_arrays, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 701, __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    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(12, 701, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(12, 701, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(12, 701, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(12, 701, __pyx_L1_error)
  __pyx_v_arrays = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_schema, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":704
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 *         return cls.from_arrays(arrays, schema=schema)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arrays);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(12, 704, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":669
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=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.lib.RecordBatch.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dataframe_to_arrays);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF((PyObject *)__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":707
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_29from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_28from_arrays[] = "RecordBatch.from_arrays(list arrays, names=None, schema=None, metadata=None)\n\n        Construct a RecordBatch from multiple pyarrow.Arrays\n\n        Parameters\n        ----------\n        arrays: list of pyarrow.Array\n            One for each field in RecordBatch\n        names : list of str, optional\n            Names for the batch fields. If not passed, schema must be passed\n        schema : Schema, default None\n            Schema for the created batch. If not passed, names must be passed\n        metadata : dict or Mapping, default None\n            Optional metadata for the schema (if inferred).\n\n        Returns\n        -------\n        pyarrow.RecordBatch\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11RecordBatch_29from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_29from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_28from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_29from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(12, 707, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = ((PyObject*)values[0]);
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 707, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arrays), (&PyList_Type), 1, "arrays", 1))) __PYX_ERR(12, 707, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_28from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_28from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  int64_t __pyx_v_num_rows;
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_v_converted_arrays = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("from_arrays", 0);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_INCREF(__pyx_v_schema);

  /* "pyarrow/table.pxi":732
 *             int64_t num_rows
 * 
 *         if len(arrays) > 0:             # <<<<<<<<<<<<<<
 *             num_rows = len(arrays[0])
 *         else:
 */
  if (unlikely(__pyx_v_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(12, 732, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 732, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 > 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":733
 * 
 *         if len(arrays) > 0:
 *             num_rows = len(arrays[0])             # <<<<<<<<<<<<<<
 *         else:
 *             num_rows = 0
 */
    if (unlikely(__pyx_v_arrays == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(12, 733, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_arrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 733, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_num_rows = __pyx_t_1;

    /* "pyarrow/table.pxi":732
 *             int64_t num_rows
 * 
 *         if len(arrays) > 0:             # <<<<<<<<<<<<<<
 *             num_rows = len(arrays[0])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":735
 *             num_rows = len(arrays[0])
 *         else:
 *             num_rows = 0             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(names, Schema):
 */
  /*else*/ {
    __pyx_v_num_rows = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":737
 *             num_rows = 0
 * 
 *         if isinstance(names, Schema):             # <<<<<<<<<<<<<<
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_names, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/table.pxi":738
 * 
 *         if isinstance(names, Schema):
 *             import warnings             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema passed to names= option, please "
 *                           "pass schema= explicitly. "
 */
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_warnings = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":739
 *         if isinstance(names, Schema):
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "             # <<<<<<<<<<<<<<
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "pyarrow/table.pxi":741
 *             warnings.warn("Schema passed to names= option, please "
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)             # <<<<<<<<<<<<<<
 *             schema = names
 *             names = None
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":742
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)
 *             schema = names             # <<<<<<<<<<<<<<
 *             names = None
 * 
 */
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_DECREF_SET(__pyx_v_schema, __pyx_v_names);

    /* "pyarrow/table.pxi":743
 *                           "Will raise exception in future", FutureWarning)
 *             schema = names
 *             names = None             # <<<<<<<<<<<<<<
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_names, Py_None);

    /* "pyarrow/table.pxi":737
 *             num_rows = 0
 * 
 *         if isinstance(names, Schema):             # <<<<<<<<<<<<<<
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "
 */
  }

  /* "pyarrow/table.pxi":745
 *             names = None
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                                             &c_schema)
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib__sanitize_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata, (&__pyx_v_c_schema)); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_converted_arrays = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":748
 *                                             &c_schema)
 * 
 *         c_arrays.reserve(len(arrays))             # <<<<<<<<<<<<<<
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:
 */
  if (unlikely(__pyx_v_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(12, 748, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 748, __pyx_L1_error)
  __pyx_v_c_arrays.reserve(__pyx_t_1);

  /* "pyarrow/table.pxi":749
 * 
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:             # <<<<<<<<<<<<<<
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 */
  if (likely(PyList_CheckExact(__pyx_v_converted_arrays)) || PyTuple_CheckExact(__pyx_v_converted_arrays)) {
    __pyx_t_5 = __pyx_v_converted_arrays; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_converted_arrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 749, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(12, 749, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 749, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(12, 749, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 749, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_5);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 749, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(12, 749, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":750
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 */
    __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(12, 750, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_7 != __pyx_v_num_rows) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":752
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))             # <<<<<<<<<<<<<<
 *             c_arrays.push_back(arr.sp_array)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Arrays_were_not_all_the_same_len, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(12, 752, __pyx_L1_error)
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyInt_From_int64_t(__pyx_v_num_rows); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 752, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 752, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__pyx_t_11) {
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_10);
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pyarrow/table.pxi":751
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '             # <<<<<<<<<<<<<<
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 *             c_arrays.push_back(arr.sp_array)
 */
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(12, 751, __pyx_L1_error)

      /* "pyarrow/table.pxi":750
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 */
    }

    /* "pyarrow/table.pxi":753
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 *             c_arrays.push_back(arr.sp_array)             # <<<<<<<<<<<<<<
 * 
 *         result = pyarrow_wrap_batch(CRecordBatch.Make(c_schema, num_rows,
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_v_arr->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(12, 753, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":749
 * 
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:             # <<<<<<<<<<<<<<
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":755
 *             c_arrays.push_back(arr.sp_array)
 * 
 *         result = pyarrow_wrap_batch(CRecordBatch.Make(c_schema, num_rows,             # <<<<<<<<<<<<<<
 *                                                       c_arrays))
 *         result.validate()
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch( arrow::RecordBatch::Make(__pyx_v_c_schema, __pyx_v_num_rows, __pyx_v_c_arrays)); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_result = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":757
 *         result = pyarrow_wrap_batch(CRecordBatch.Make(c_schema, num_rows,
 *                                                       c_arrays))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_validate); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":758
 *                                                       c_arrays))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":707
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":761
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_139_reconstruct_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_138_reconstruct_record_batch[] = "_reconstruct_record_batch(columns, schema)\n\n    Internal: reconstruct RecordBatch from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_139_reconstruct_record_batch = {"_reconstruct_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_139_reconstruct_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_138_reconstruct_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_139_reconstruct_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reconstruct_record_batch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_columns,&__pyx_n_s_schema,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_columns)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_reconstruct_record_batch", 1, 2, 2, 1); __PYX_ERR(12, 761, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_reconstruct_record_batch") < 0)) __PYX_ERR(12, 761, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_columns = values[0];
    __pyx_v_schema = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_reconstruct_record_batch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 761, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._reconstruct_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_138_reconstruct_record_batch(__pyx_self, __pyx_v_columns, __pyx_v_schema);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_138_reconstruct_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_reconstruct_record_batch", 0);

  /* "pyarrow/table.pxi":765
 *     Internal: reconstruct RecordBatch from pickled components.
 *     """
 *     return RecordBatch.from_arrays(columns, schema=schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_columns);
  __Pyx_GIVEREF(__pyx_v_columns);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_columns);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 765, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":761
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */

  /* 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.lib._reconstruct_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":768
 * 
 * 
 * def table_to_blocks(options, Table table, categories):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_141table_to_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_140table_to_blocks[] = "table_to_blocks(options, Table table, categories)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_141table_to_blocks = {"table_to_blocks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_141table_to_blocks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_140table_to_blocks};
static PyObject *__pyx_pw_7pyarrow_3lib_141table_to_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_v_categories = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table_to_blocks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,&__pyx_n_s_table,&__pyx_n_s_categories,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 3, 3, 1); __PYX_ERR(12, 768, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 3, 3, 2); __PYX_ERR(12, 768, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "table_to_blocks") < 0)) __PYX_ERR(12, 768, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_options = values[0];
    __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)values[1]);
    __pyx_v_categories = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 768, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.table_to_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), __pyx_ptype_7pyarrow_3lib_Table, 1, "table", 0))) __PYX_ERR(12, 768, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_140table_to_blocks(__pyx_self, __pyx_v_options, __pyx_v_table, __pyx_v_categories);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_140table_to_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_options, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_categories) {
  PyObject *__pyx_v_result_obj;
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  std::unordered_set<std::string>  __pyx_v_categorical_columns;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_9genexpr10__pyx_v_cat = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Table>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  std::unordered_set<std::string>  __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("table_to_blocks", 0);

  /* "pyarrow/table.pxi":771
 *     cdef:
 *         PyObject* result_obj
 *         shared_ptr[CTable] c_table = table.sp_table             # <<<<<<<<<<<<<<
 *         CMemoryPool* pool
 *         unordered_set[c_string] categorical_columns
 */
  __pyx_t_1 = __pyx_v_table->sp_table;
  __pyx_v_c_table = __pyx_t_1;

  /* "pyarrow/table.pxi":774
 *         CMemoryPool* pool
 *         unordered_set[c_string] categorical_columns
 *         PandasOptions c_options = _convert_pandas_options(options)             # <<<<<<<<<<<<<<
 * 
 *     if categories is not None:
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_options))||((__pyx_v_options) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_options)->tp_name), 0))) __PYX_ERR(12, 774, __pyx_L1_error)
  __pyx_v_c_options = __pyx_f_7pyarrow_3lib__convert_pandas_options(((PyObject*)__pyx_v_options));

  /* "pyarrow/table.pxi":776
 *         PandasOptions c_options = _convert_pandas_options(options)
 * 
 *     if categories is not None:             # <<<<<<<<<<<<<<
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 */
  __pyx_t_2 = (__pyx_v_categories != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":777
 * 
 *     if categories is not None:
 *         categorical_columns = {tobytes(cat) for cat in categories}             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    { /* enter inner scope */
      __pyx_t_4 = PySet_New(NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 777, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (likely(PyList_CheckExact(__pyx_v_categories)) || PyTuple_CheckExact(__pyx_v_categories)) {
        __pyx_t_5 = __pyx_v_categories; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_categories); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 777, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 777, __pyx_L6_error)
      }
      for (;;) {
        if (likely(!__pyx_t_7)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(12, 777, __pyx_L6_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 777, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(12, 777, __pyx_L6_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 777, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_7(__pyx_t_5);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(12, 777, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_cat, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 777, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_9genexpr10__pyx_v_cat) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_9genexpr10__pyx_v_cat);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 777, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(PySet_Add(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(12, 777, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_cat); __pyx_9genexpr10__pyx_v_cat = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_cat); __pyx_9genexpr10__pyx_v_cat = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */
    __pyx_t_11 = __pyx_convert_unordered_set_from_py_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 777, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_categorical_columns = __pyx_t_11;

    /* "pyarrow/table.pxi":776
 *         PandasOptions c_options = _convert_pandas_options(options)
 * 
 *     if categories is not None:             # <<<<<<<<<<<<<<
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 */
  }

  /* "pyarrow/table.pxi":779
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             libarrow.ConvertTableToPandas(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":780
 * 
 *     with nogil:
 *         check_status(             # <<<<<<<<<<<<<<
 *             libarrow.ConvertTableToPandas(
 *                 c_options, categorical_columns, c_table, &result_obj)
 */
        __pyx_t_12 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertTableToPandas(__pyx_v_c_options, __pyx_v_categorical_columns, __pyx_v_c_table, (&__pyx_v_result_obj))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(12, 780, __pyx_L11_error)
      }

      /* "pyarrow/table.pxi":779
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             libarrow.ConvertTableToPandas(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L12;
        }
        __pyx_L11_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pyarrow/table.pxi":785
 *         )
 * 
 *     return PyObject_to_object(result_obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_result_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":768
 * 
 * 
 * def table_to_blocks(options, Table table, categories):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.table_to_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_cat);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":798
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Table_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Table_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table___cinit__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Table___cinit__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/table.pxi":799
 * 
 *     def __cinit__(self):
 *         self.table = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->table = NULL;

  /* "pyarrow/table.pxi":798
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":801
 *         self.table = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Table's constructor directly, use one of "
 *                         "the `Table.from_*` functions instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Table_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Table_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_2__init__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Table_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/table.pxi":802
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Table's constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `Table.from_*` functions instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__159, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 802, __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(12, 802, __pyx_L1_error)

  /* "pyarrow/table.pxi":801
 *         self.table = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Table's constructor directly, use one of "
 *                         "the `Table.from_*` functions instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":805
 *                         "the `Table.from_*` functions instead.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_4__repr__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_4__repr__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/table.pxi":806
 * 
 *     def __repr__(self):
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 806, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 806, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":805
 *                         "the `Table.from_*` functions instead.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":808
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):             # <<<<<<<<<<<<<<
 *         self.sp_table = table
 *         self.table = table.get()
 */

static void __pyx_f_7pyarrow_3lib_5Table_init(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, std::shared_ptr< arrow::Table>  const &__pyx_v_table) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/table.pxi":809
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):
 *         self.sp_table = table             # <<<<<<<<<<<<<<
 *         self.table = table.get()
 * 
 */
  __pyx_v_self->sp_table = __pyx_v_table;

  /* "pyarrow/table.pxi":810
 *     cdef void init(self, const shared_ptr[CTable]& table):
 *         self.sp_table = table
 *         self.table = table.get()             # <<<<<<<<<<<<<<
 * 
 *     def validate(self):
 */
  __pyx_v_self->table = __pyx_v_table.get();

  /* "pyarrow/table.pxi":808
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):             # <<<<<<<<<<<<<<
 *         self.sp_table = table
 *         self.table = table.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/table.pxi":812
 *         self.table = table.get()
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate table consistency.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_6validate[] = "Table.validate(self)\n\n        Validate table consistency.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_6validate(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6validate(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/table.pxi":816
 *         Validate table consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Validate())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":817
 *         """
 *         with nogil:
 *             check_status(self.table.Validate())             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 817, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":816
 *         Validate table consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Validate())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":812
 *         self.table = table.get()
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate table consistency.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":819
 *             check_status(self.table.Validate())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         # Reduce the columns as ChunkedArrays to avoid serializing schema
 *         # data twice
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_8__reduce__[] = "Table.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_8__reduce__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_9genexpr11__pyx_v_col = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/table.pxi":822
 *         # Reduce the columns as ChunkedArrays to avoid serializing schema
 *         # data twice
 *         columns = [col for col in self.columns]             # <<<<<<<<<<<<<<
 *         return _reconstruct_table, (columns, self.schema)
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 822, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 822, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 822, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 822, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 822, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 822, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 822, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 822, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 822, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_col, __pyx_t_2);
      __pyx_t_2 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr11__pyx_v_col))) __PYX_ERR(12, 822, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_col); __pyx_9genexpr11__pyx_v_col = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_col); __pyx_9genexpr11__pyx_v_col = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":823
 *         # data twice
 *         columns = [col for col in self.columns]
 *         return _reconstruct_table, (columns, self.schema)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_reconstruct_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_columns);
  __Pyx_GIVEREF(__pyx_v_columns);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_columns);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":819
 *             check_status(self.table.Validate())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         # Reduce the columns as ChunkedArrays to avoid serializing schema
 *         # data twice
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":825
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_10__getitem__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_10__getitem__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":826
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":827
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.column(key)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 827, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 827, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_key);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":826
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":829
 *             return _normalize_slice(self, key)
 *         else:
 *             return self.column(key)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":825
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

  /* 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.lib.Table.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":831
 *             return self.column(key)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this Table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_13slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_12slice[] = "Table.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this Table\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of table to slice\n        length : int, default None\n            Length of slice (default is until end of table starting from\n            offset)\n\n        Returns\n        -------\n        sliced : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_13slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(12, 831, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 831, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_12slice(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12slice(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::Table>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/table.pxi":849
 *         cdef shared_ptr[CTable] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 849, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":850
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 850, __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(12, 850, __pyx_L1_error)

    /* "pyarrow/table.pxi":849
 *         cdef shared_ptr[CTable] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":852
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.table.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":853
 * 
 *         if length is None:
 *             result = self.table.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.table.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 853, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->table->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":852
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.table.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":855
 *             result = self.table.Slice(offset)
 *         else:
 *             result = self.table.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 855, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 855, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->table->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":857
 *             result = self.table.Slice(offset, length)
 * 
 *         return pyarrow_wrap_table(result)             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, metadata=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":831
 *             return self.column(key)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this Table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":859
 *         return pyarrow_wrap_table(result)
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_15replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_14replace_schema_metadata[] = "Table.replace_schema_metadata(self, metadata=None)\n\n        EXPERIMENTAL: Create shallow copy of table by replacing schema\n        key-value metadata with the indicated new metadata (which may be None,\n        which deletes any existing metadata\n\n        Parameters\n        ----------\n        metadata : dict, default None\n\n        Returns\n        -------\n        shallow_copy : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_15replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace_schema_metadata (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metadata,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace_schema_metadata") < 0)) __PYX_ERR(12, 859, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_metadata = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace_schema_metadata", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 859, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_14replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_14replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":877
 *             shared_ptr[CTable] c_table
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_1 = (__pyx_v_metadata != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":878
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_2 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":879
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 879, __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(12, 879, __pyx_L1_error)

      /* "pyarrow/table.pxi":878
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":880
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":877
 *             shared_ptr[CTable] c_table
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":882
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":883
 * 
 *         with nogil:
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_v_c_table = __pyx_v_self->table->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":882
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":885
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __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(12, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":859
 *         return pyarrow_wrap_table(result)
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":887
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Table.  Each column with a struct type is flattened
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_17flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_16flatten[] = "Table.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this Table.  Each column with a struct type is flattened\n        into one column per struct field.  Other columns are left unchanged.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_17flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(12, 887, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 887, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(12, 887, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_16flatten(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_16flatten(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Table>  __pyx_v_flattened;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/table.pxi":903
 *         cdef:
 *             shared_ptr[CTable] flattened
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":905
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":906
 * 
 *         with nogil:
 *             check_status(self.table.Flatten(pool, &flattened))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(flattened)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->Flatten(__pyx_v_pool, (&__pyx_v_flattened))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 906, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":905
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":908
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 *         return pyarrow_wrap_table(flattened)             # <<<<<<<<<<<<<<
 * 
 *     def combine_chunks(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_flattened); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":887
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Table.  Each column with a struct type is flattened
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Table.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":910
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def combine_chunks(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Make a new table by combining the chunks this table has.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_19combine_chunks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_18combine_chunks[] = "Table.combine_chunks(self, MemoryPool memory_pool=None)\n\n        Make a new table by combining the chunks this table has.\n\n        All the underlying chunks in the ChunkedArray of each column are\n        concatenated into zero or one chunk.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_19combine_chunks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("combine_chunks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "combine_chunks") < 0)) __PYX_ERR(12, 910, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("combine_chunks", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 910, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.combine_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(12, 910, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_18combine_chunks(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_18combine_chunks(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Table>  __pyx_v_combined;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("combine_chunks", 0);

  /* "pyarrow/table.pxi":928
 *         cdef:
 *             shared_ptr[CTable] combined
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":930
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.CombineChunks(pool, &combined))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":931
 * 
 *         with nogil:
 *             check_status(self.table.CombineChunks(pool, &combined))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(combined)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->CombineChunks(__pyx_v_pool, (&__pyx_v_combined))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 931, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":930
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.CombineChunks(pool, &combined))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":933
 *             check_status(self.table.CombineChunks(pool, &combined))
 * 
 *         return pyarrow_wrap_table(combined)             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_combined); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":910
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def combine_chunks(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Make a new table by combining the chunks this table has.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Table.combine_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":935
 *         return pyarrow_wrap_table(combined)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_21__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_21__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_20__eq__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_20__eq__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/table.pxi":936
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __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/table.pxi":937
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 937, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 937, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/table.pxi":936
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __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;

    /* "pyarrow/table.pxi":938
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Table.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(12, 938, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/table.pxi":939
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Table other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/table.pxi":936
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":935
 *         return pyarrow_wrap_table(combined)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":941
 *             return NotImplemented
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_22equals[] = "Table.equals(self, Table other)\n\n        Check if contents of two tables are equal\n\n        Parameters\n        ----------\n        other : pyarrow.Table\n\n        Returns\n        -------\n        are_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Table, 1, "other", 0))) __PYX_ERR(12, 941, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_22equals(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_22equals(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_other) {
   arrow::Table *__pyx_v_this_table;
   arrow::Table *__pyx_v_other_table;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::Table *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":954
 *         """
 *         cdef:
 *             CTable* this_table = self.table             # <<<<<<<<<<<<<<
 *             CTable* other_table = other.table
 *             c_bool result
 */
  __pyx_t_1 = __pyx_v_self->table;
  __pyx_v_this_table = __pyx_t_1;

  /* "pyarrow/table.pxi":955
 *         cdef:
 *             CTable* this_table = self.table
 *             CTable* other_table = other.table             # <<<<<<<<<<<<<<
 *             c_bool result
 * 
 */
  __pyx_t_1 = __pyx_v_other->table;
  __pyx_v_other_table = __pyx_t_1;

  /* "pyarrow/table.pxi":958
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_other) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":959
 * 
 *         if other is None:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":958
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pyarrow/table.pxi":961
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_table.Equals(deref(other_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":962
 * 
 *         with nogil:
 *             result = this_table.Equals(deref(other_table))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result = __pyx_v_this_table->Equals((*__pyx_v_other_table));
      }

      /* "pyarrow/table.pxi":961
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_table.Equals(deref(other_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":964
 *             result = this_table.Equals(deref(other_table))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, Schema target_schema, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":941
 *             return NotImplemented
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":966
 *         return result
 * 
 *     def cast(self, Schema target_schema, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast table values to another schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_25cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_24cast[] = "Table.cast(self, Schema target_schema, bool safe=True)\n\n        Cast table values to another schema\n\n        Parameters\n        ----------\n        target_schema : Schema\n            Schema to cast to, the names and order of fields must match\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_25cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_target_schema = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target_schema,&__pyx_n_s_safe,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_schema)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast") < 0)) __PYX_ERR(12, 966, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    if (values[1]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 966, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 966, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "target_schema", 0))) __PYX_ERR(12, 966, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_24cast(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_target_schema, __pyx_v_safe);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_24cast(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_target_schema, int __pyx_v_safe) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_column = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_casted = 0;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_v_newcols = 0;
  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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("cast", 0);

  /* "pyarrow/table.pxi":984
 *             ChunkedArray column, casted
 *             Field field
 *             list newcols = []             # <<<<<<<<<<<<<<
 * 
 *         if self.schema.names != target_schema.names:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_newcols = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":986
 *             list newcols = []
 * 
 *         if self.schema.names != target_schema.names:             # <<<<<<<<<<<<<<
 *             raise ValueError("Target schema's field names are not matching "
 *                              "the table's field names: {!r}, {!r}"
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_target_schema), __pyx_n_s_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 986, __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(12, 986, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/table.pxi":989
 *             raise ValueError("Target schema's field names are not matching "
 *                              "the table's field names: {!r}, {!r}"
 *                              .format(self.schema.names, target_schema.names))             # <<<<<<<<<<<<<<
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Target_schema_s_field_names_are, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_target_schema), __pyx_n_s_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 989, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 989, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_2);
      __pyx_t_5 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":987
 * 
 *         if self.schema.names != target_schema.names:
 *             raise ValueError("Target schema's field names are not matching "             # <<<<<<<<<<<<<<
 *                              "the table's field names: {!r}, {!r}"
 *                              .format(self.schema.names, target_schema.names))
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(12, 987, __pyx_L1_error)

    /* "pyarrow/table.pxi":986
 *             list newcols = []
 * 
 *         if self.schema.names != target_schema.names:             # <<<<<<<<<<<<<<
 *             raise ValueError("Target schema's field names are not matching "
 *                              "the table's field names: {!r}, {!r}"
 */
  }

  /* "pyarrow/table.pxi":991
 *                              .format(self.schema.names, target_schema.names))
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):             # <<<<<<<<<<<<<<
 *             casted = column.cast(field.type, safe=safe)
 *             newcols.append(casted)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_itercolumns); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_target_schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_target_schema));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_target_schema));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 991, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(12, 991, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(12, 991, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 991, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      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(12, 991, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(12, 991, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(12, 991, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 991, __pyx_L1_error)
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(12, 991, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_column, ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_8));
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":992
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):
 *             casted = column.cast(field.type, safe=safe)             # <<<<<<<<<<<<<<
 *             newcols.append(casted)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_column), __pyx_n_s_cast); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_field->type));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_field->type));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_field->type));
    __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_safe, __pyx_t_5) < 0) __PYX_ERR(12, 992, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 992, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_casted, ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":993
 *         for column, field in zip(self.itercolumns(), target_schema):
 *             casted = column.cast(field.type, safe=safe)
 *             newcols.append(casted)             # <<<<<<<<<<<<<<
 * 
 *         return Table.from_arrays(newcols, schema=target_schema)
 */
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_newcols, ((PyObject *)__pyx_v_casted)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(12, 993, __pyx_L1_error)

    /* "pyarrow/table.pxi":991
 *                              .format(self.schema.names, target_schema.names))
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):             # <<<<<<<<<<<<<<
 *             casted = column.cast(field.type, safe=safe)
 *             newcols.append(casted)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":995
 *             newcols.append(casted)
 * 
 *         return Table.from_arrays(newcols, schema=target_schema)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_newcols);
  __Pyx_GIVEREF(__pyx_v_newcols);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_newcols);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_schema, ((PyObject *)__pyx_v_target_schema)) < 0) __PYX_ERR(12, 995, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":966
 *         return result
 * 
 *     def cast(self, Schema target_schema, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast table values to another schema
 */

  /* 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_column);
  __Pyx_XDECREF((PyObject *)__pyx_v_casted);
  __Pyx_XDECREF((PyObject *)__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_newcols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":998
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_27from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_26from_pandas[] = "Table.from_pandas(type cls, df, Schema schema=None, preserve_index=None, nthreads=None, columns=None, bool safe=True)\n\n        Convert pandas.DataFrame to an Arrow Table.\n\n        The column types in the resulting Arrow Table are inferred from the\n        dtypes of the pandas.Series in the DataFrame. In the case of non-object\n        Series, the NumPy dtype is translated to its Arrow equivalent. In the\n        case of `object`, we need to guess the datatype by looking at the\n        Python objects in this Series.\n\n        Be aware that Series of the `object` dtype don't carry enough\n        information to always lead to a meaningful Arrow type. In the case that\n        we cannot infer a type, e.g. because the DataFrame is of length 0 or\n        the Series only contains None/nan objects, the type is set to\n        null. This behavior can be avoided by constructing an explicit schema\n        and passing it to this function.\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        schema : pyarrow.Schema, optional\n            The expected schema of the Arrow Table. This can be used to\n            indicate the type of columns if we cannot infer it automatically.\n            If passed, the output will have exactly this schema. Columns\n            specified in the schema that are not found in the DataFrame columns\n            or its index will raise an error. Additional columns or index\n            levels in the DataFrame which are not specified in the schema will\n            be ignored.\n        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``Table``. The default of None will store the index as a column,\n            except for RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n        nthreads : int, default None (may use up to system CPU count threads)\n            If gre""ater than 1, convert columns to Arrow in parallel using\n            indicated number of threads\n        columns : list, optional\n           List of column to be converted. If None, use all columns.\n        safe : boolean, default True\n           Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        pyarrow.Table\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Table.from_pandas(df)\n        <pyarrow.lib.Table object at 0x7f05d1fb1b40>\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_27from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_preserve_index = 0;
  PyObject *__pyx_v_nthreads = 0;
  PyObject *__pyx_v_columns = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_schema,&__pyx_n_s_preserve_index,&__pyx_n_s_nthreads,&__pyx_n_s_columns,&__pyx_n_s_safe,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/table.pxi":999
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.DataFrame to an Arrow Table.
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_index);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(12, 998, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_preserve_index = values[2];
    __pyx_v_nthreads = values[3];
    __pyx_v_columns = values[4];
    if (values[5]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 999, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 998, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(12, 998, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_26from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_schema, __pyx_v_preserve_index, __pyx_v_nthreads, __pyx_v_columns, __pyx_v_safe);

  /* "pyarrow/table.pxi":998
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_26from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns, int __pyx_v_safe) {
  PyObject *__pyx_v_dataframe_to_arrays = NULL;
  PyObject *__pyx_v_arrays = 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)(PyObject *);
  __Pyx_RefNannySetupContext("from_pandas", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_schema);

  /* "pyarrow/table.pxi":1056
 *         <pyarrow.lib.Table object at 0x7f05d1fb1b40>
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays             # <<<<<<<<<<<<<<
 *         arrays, schema = dataframe_to_arrays(
 *             df,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_arrays);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_arrays);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_arrays);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_arrays = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1057
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);

  /* "pyarrow/table.pxi":1059
 *         arrays, schema = dataframe_to_arrays(
 *             df,
 *             schema=schema,             # <<<<<<<<<<<<<<
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(12, 1059, __pyx_L1_error)

  /* "pyarrow/table.pxi":1060
 *             df,
 *             schema=schema,
 *             preserve_index=preserve_index,             # <<<<<<<<<<<<<<
 *             nthreads=nthreads,
 *             columns=columns,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_preserve_index, __pyx_v_preserve_index) < 0) __PYX_ERR(12, 1059, __pyx_L1_error)

  /* "pyarrow/table.pxi":1061
 *             schema=schema,
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             safe=safe
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(12, 1059, __pyx_L1_error)

  /* "pyarrow/table.pxi":1062
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 *             columns=columns,             # <<<<<<<<<<<<<<
 *             safe=safe
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(12, 1059, __pyx_L1_error)

  /* "pyarrow/table.pxi":1063
 *             nthreads=nthreads,
 *             columns=columns,
 *             safe=safe             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, schema=schema)
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_safe, __pyx_t_3) < 0) __PYX_ERR(12, 1059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1057
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_arrays, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1057, __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    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(12, 1057, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(12, 1057, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(12, 1057, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(12, 1057, __pyx_L1_error)
  __pyx_v_arrays = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_schema, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1065
 *             safe=safe
 *         )
 *         return cls.from_arrays(arrays, schema=schema)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arrays);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(12, 1065, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":998
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */

  /* 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.lib.Table.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dataframe_to_arrays);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF((PyObject *)__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1068
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_28from_arrays[] = "Table.from_arrays(arrays, names=None, schema=None, metadata=None)\n\n        Construct a Table from Arrow arrays\n\n        Parameters\n        ----------\n        arrays : list of pyarrow.Array or pyarrow.ChunkedArray\n            Equal-length arrays that should form the table.\n        names : list of str, optional\n            Names for the table columns. If not passed, schema must be passed\n        schema : Schema, default None\n            Schema for the created table. If not passed, names must be passed\n        metadata : dict or Mapping, default None\n            Optional metadata for the schema (if inferred).\n\n        Returns\n        -------\n        pyarrow.Table\n\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_29from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_29from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_28from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(12, 1068, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1068, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_28from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_28from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  std::vector<std::shared_ptr< arrow::ChunkedArray> >  __pyx_v_columns;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  int __pyx_v_K;
  PyObject *__pyx_v_converted_arrays = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/table.pxi":1091
 *             vector[shared_ptr[CChunkedArray]] columns
 *             shared_ptr[CSchema] c_schema
 *             int i, K = <int> len(arrays)             # <<<<<<<<<<<<<<
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 1091, __pyx_L1_error)
  __pyx_v_K = ((int)__pyx_t_1);

  /* "pyarrow/table.pxi":1093
 *             int i, K = <int> len(arrays)
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                                             &c_schema)
 * 
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__sanitize_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata, (&__pyx_v_c_schema)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_converted_arrays = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1096
 *                                             &c_schema)
 * 
 *         columns.reserve(K)             # <<<<<<<<<<<<<<
 *         for item in converted_arrays:
 *             if isinstance(item, Array):
 */
  __pyx_v_columns.reserve(__pyx_v_K);

  /* "pyarrow/table.pxi":1097
 * 
 *         columns.reserve(K)
 *         for item in converted_arrays:             # <<<<<<<<<<<<<<
 *             if isinstance(item, Array):
 *                 columns.push_back(
 */
  if (likely(PyList_CheckExact(__pyx_v_converted_arrays)) || PyTuple_CheckExact(__pyx_v_converted_arrays)) {
    __pyx_t_2 = __pyx_v_converted_arrays; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_converted_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1097, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(12, 1097, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1097, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(12, 1097, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1097, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1097, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1098
 *         columns.reserve(K)
 *         for item in converted_arrays:
 *             if isinstance(item, Array):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CChunkedArray](
 */
    __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Array); 
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/table.pxi":1100
 *             if isinstance(item, Array):
 *                 columns.push_back(
 *                     make_shared[CChunkedArray](             # <<<<<<<<<<<<<<
 *                         (<Array> item).sp_array
 *                     )
 */
      try {
        __pyx_t_7 = std::make_shared< arrow::ChunkedArray>(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_item)->sp_array);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(12, 1100, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1099
 *         for item in converted_arrays:
 *             if isinstance(item, Array):
 *                 columns.push_back(             # <<<<<<<<<<<<<<
 *                     make_shared[CChunkedArray](
 *                         (<Array> item).sp_array
 */
      try {
        __pyx_v_columns.push_back(__pyx_t_7);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(12, 1099, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1098
 *         columns.reserve(K)
 *         for item in converted_arrays:
 *             if isinstance(item, Array):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CChunkedArray](
 */
      goto __pyx_L5;
    }

    /* "pyarrow/table.pxi":1104
 *                     )
 *                 )
 *             elif isinstance(item, ChunkedArray):             # <<<<<<<<<<<<<<
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)
 *             else:
 */
    __pyx_t_6 = __Pyx_TypeCheck(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (likely(__pyx_t_5)) {

      /* "pyarrow/table.pxi":1105
 *                 )
 *             elif isinstance(item, ChunkedArray):
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(type(item))
 */
      try {
        __pyx_v_columns.push_back(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_item)->sp_chunked_array);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(12, 1105, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1104
 *                     )
 *                 )
 *             elif isinstance(item, ChunkedArray):             # <<<<<<<<<<<<<<
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "pyarrow/table.pxi":1107
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)
 *             else:
 *                 raise TypeError(type(item))             # <<<<<<<<<<<<<<
 * 
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1107, __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(12, 1107, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "pyarrow/table.pxi":1097
 * 
 *         columns.reserve(K)
 *         for item in converted_arrays:             # <<<<<<<<<<<<<<
 *             if isinstance(item, Array):
 *                 columns.push_back(
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1109
 *                 raise TypeError(type(item))
 * 
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table( arrow::Table::Make(__pyx_v_c_schema, __pyx_v_columns)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1110
 * 
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_validate); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1111
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1068
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1114
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_31from_pydict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_30from_pydict[] = "Table.from_pydict(mapping, schema=None, metadata=None)\n\n        Construct a Table from Arrow arrays or columns\n\n        Parameters\n        ----------\n        mapping : dict or Mapping\n            A mapping of strings to Arrays or Python lists.\n        schema : Schema, default None\n            If not passed, will be inferred from the Mapping values\n        metadata : dict or Mapping, default None\n            Optional metadata for the schema (if inferred).\n\n        Returns\n        -------\n        pyarrow.Table\n\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_31from_pydict = {"from_pydict", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_31from_pydict, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_30from_pydict};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_31from_pydict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mapping = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pydict (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mapping)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pydict") < 0)) __PYX_ERR(12, 1114, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_mapping = values[0];
    __pyx_v_schema = values[1];
    __pyx_v_metadata = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pydict", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1114, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_30from_pydict(__pyx_v_mapping, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_30from_pydict(PyObject *__pyx_v_mapping, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e2 = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  char const *__pyx_t_28;
  int __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  __Pyx_RefNannySetupContext("from_pydict", 0);

  /* "pyarrow/table.pxi":1132
 * 
 *         """
 *         arrays = []             # <<<<<<<<<<<<<<
 *         if schema is not None:
 *             for field in schema:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1133
 *         """
 *         arrays = []
 *         if schema is not None:             # <<<<<<<<<<<<<<
 *             for field in schema:
 *                 try:
 */
  __pyx_t_2 = (__pyx_v_schema != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1134
 *         arrays = []
 *         if schema is not None:
 *             for field in schema:             # <<<<<<<<<<<<<<
 *                 try:
 *                     v = mapping[field.name]
 */
    if (likely(PyList_CheckExact(__pyx_v_schema)) || PyTuple_CheckExact(__pyx_v_schema)) {
      __pyx_t_1 = __pyx_v_schema; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1134, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 1134, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1134, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 1134, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1134, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 1134, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pyarrow/table.pxi":1135
 *         if schema is not None:
 *             for field in schema:
 *                 try:             # <<<<<<<<<<<<<<
 *                     v = mapping[field.name]
 *                 except KeyError as e:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "pyarrow/table.pxi":1136
 *             for field in schema:
 *                 try:
 *                     v = mapping[field.name]             # <<<<<<<<<<<<<<
 *                 except KeyError as e:
 *                     try:
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1136, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_mapping, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 1136, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_10);
          __pyx_t_10 = 0;

          /* "pyarrow/table.pxi":1135
 *         if schema is not None:
 *             for field in schema:
 *                 try:             # <<<<<<<<<<<<<<
 *                     v = mapping[field.name]
 *                 except KeyError as e:
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L13_try_end;
        __pyx_L6_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "pyarrow/table.pxi":1137
 *                 try:
 *                     v = mapping[field.name]
 *                 except KeyError as e:             # <<<<<<<<<<<<<<
 *                     try:
 *                         v = mapping[tobytes(field.name)]
 */
        __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_11) {
          __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(12, 1137, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_6);
          __pyx_v_e = __pyx_t_6;
          /*try:*/ {

            /* "pyarrow/table.pxi":1138
 *                     v = mapping[field.name]
 *                 except KeyError as e:
 *                     try:             # <<<<<<<<<<<<<<
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError as e2:
 */
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_15);
              /*try:*/ {

                /* "pyarrow/table.pxi":1139
 *                 except KeyError as e:
 *                     try:
 *                         v = mapping[tobytes(field.name)]             # <<<<<<<<<<<<<<
 *                     except KeyError as e2:
 *                         raise e
 */
                __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_17)) __PYX_ERR(12, 1139, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_17);
                __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1139, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_18);
                __pyx_t_19 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
                  __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_17);
                  if (likely(__pyx_t_19)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
                    __Pyx_INCREF(__pyx_t_19);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_17, function);
                  }
                }
                __pyx_t_16 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_19, __pyx_t_18) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_18);
                __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                if (unlikely(!__pyx_t_16)) __PYX_ERR(12, 1139, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_mapping, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(12, 1139, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_17);
                __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_17);
                __pyx_t_17 = 0;

                /* "pyarrow/table.pxi":1138
 *                     v = mapping[field.name]
 *                 except KeyError as e:
 *                     try:             # <<<<<<<<<<<<<<
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError as e2:
 */
              }
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              goto __pyx_L28_try_end;
              __pyx_L21_error:;
              __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_19); __pyx_t_19 = 0;

              /* "pyarrow/table.pxi":1140
 *                     try:
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError as e2:             # <<<<<<<<<<<<<<
 *                         raise e
 *                 arrays.append(asarray(v, type=field.type))
 */
              __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
              if (__pyx_t_11) {
                __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_17, &__pyx_t_16, &__pyx_t_18) < 0) __PYX_ERR(12, 1140, __pyx_L23_except_error)
                __Pyx_GOTREF(__pyx_t_17);
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_GOTREF(__pyx_t_18);
                __Pyx_INCREF(__pyx_t_16);
                __pyx_v_e2 = __pyx_t_16;
                /*try:*/ {

                  /* "pyarrow/table.pxi":1141
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError as e2:
 *                         raise e             # <<<<<<<<<<<<<<
 *                 arrays.append(asarray(v, type=field.type))
 *             # Will raise if metadata is not None
 */
                  __Pyx_Raise(__pyx_v_e, 0, 0, 0);
                  __PYX_ERR(12, 1141, __pyx_L34_error)
                }

                /* "pyarrow/table.pxi":1140
 *                     try:
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError as e2:             # <<<<<<<<<<<<<<
 *                         raise e
 *                 arrays.append(asarray(v, type=field.type))
 */
                /*finally:*/ {
                  __pyx_L34_error:;
                  /*exception exit:*/{
                    __Pyx_PyThreadState_declare
                    __Pyx_PyThreadState_assign
                    __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
                    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                    if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
                    if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
                    __Pyx_XGOTREF(__pyx_t_22);
                    __Pyx_XGOTREF(__pyx_t_23);
                    __Pyx_XGOTREF(__pyx_t_24);
                    __Pyx_XGOTREF(__pyx_t_25);
                    __Pyx_XGOTREF(__pyx_t_26);
                    __Pyx_XGOTREF(__pyx_t_27);
                    __pyx_t_11 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
                    {
                      __Pyx_DECREF(__pyx_v_e2);
                      __pyx_v_e2 = NULL;
                    }
                    if (PY_MAJOR_VERSION >= 3) {
                      __Pyx_XGIVEREF(__pyx_t_25);
                      __Pyx_XGIVEREF(__pyx_t_26);
                      __Pyx_XGIVEREF(__pyx_t_27);
                      __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
                    }
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_XGIVEREF(__pyx_t_23);
                    __Pyx_XGIVEREF(__pyx_t_24);
                    __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
                    __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
                    __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
                    goto __pyx_L23_except_error;
                  }
                }
              }
              goto __pyx_L23_except_error;
              __pyx_L23_except_error:;

              /* "pyarrow/table.pxi":1138
 *                     v = mapping[field.name]
 *                 except KeyError as e:
 *                     try:             # <<<<<<<<<<<<<<
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError as e2:
 */
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
              goto __pyx_L19_error;
              __pyx_L28_try_end:;
            }
          }

          /* "pyarrow/table.pxi":1137
 *                 try:
 *                     v = mapping[field.name]
 *                 except KeyError as e:             # <<<<<<<<<<<<<<
 *                     try:
 *                         v = mapping[tobytes(field.name)]
 */
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e);
              __pyx_v_e = NULL;
              goto __pyx_L20;
            }
            __pyx_L19_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 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_19); __pyx_t_19 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_25);
              __pyx_t_20 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_28 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e);
                __pyx_v_e = NULL;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_27);
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_26, __pyx_t_25);
              }
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ErrRestore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
              __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0;
              __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_28;
              goto __pyx_L8_except_error;
            }
            __pyx_L20:;
          }
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L7_exception_handled;
        }
        goto __pyx_L8_except_error;
        __pyx_L8_except_error:;

        /* "pyarrow/table.pxi":1135
 *         if schema is not None:
 *             for field in schema:
 *                 try:             # <<<<<<<<<<<<<<
 *                     v = mapping[field.name]
 *                 except KeyError as e:
 */
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L7_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_L13_try_end:;
      }

      /* "pyarrow/table.pxi":1142
 *                     except KeyError as e2:
 *                         raise e
 *                 arrays.append(asarray(v, type=field.type))             # <<<<<<<<<<<<<<
 *             # Will raise if metadata is not None
 *             return Table.from_arrays(arrays, schema=schema, metadata=metadata)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 1142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_v);
      __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 1142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_type, __pyx_t_18) < 0) __PYX_ERR(12, 1142, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_29 = __Pyx_PyList_Append(__pyx_v_arrays, __pyx_t_18); if (unlikely(__pyx_t_29 == ((int)-1))) __PYX_ERR(12, 1142, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

      /* "pyarrow/table.pxi":1134
 *         arrays = []
 *         if schema is not None:
 *             for field in schema:             # <<<<<<<<<<<<<<
 *                 try:
 *                     v = mapping[field.name]
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1144
 *                 arrays.append(asarray(v, type=field.type))
 *             # Will raise if metadata is not None
 *             return Table.from_arrays(arrays, schema=schema, metadata=metadata)             # <<<<<<<<<<<<<<
 *         else:
 *             names = []
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_arrays);
    __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1144, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(12, 1144, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_18, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1133
 *         """
 *         arrays = []
 *         if schema is not None:             # <<<<<<<<<<<<<<
 *             for field in schema:
 *                 try:
 */
  }

  /* "pyarrow/table.pxi":1146
 *             return Table.from_arrays(arrays, schema=schema, metadata=metadata)
 *         else:
 *             names = []             # <<<<<<<<<<<<<<
 *             for k, v in mapping.items():
 *                 names.append(k)
 */
  /*else*/ {
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_names = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1147
 *         else:
 *             names = []
 *             for k, v in mapping.items():             # <<<<<<<<<<<<<<
 *                 names.append(k)
 *                 arrays.append(asarray(v))
 */
    __pyx_t_4 = 0;
    if (unlikely(__pyx_v_mapping == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(12, 1147, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_mapping, 0, __pyx_n_s_items, (&__pyx_t_30), (&__pyx_t_11)); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 1147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_6);
    __pyx_t_6 = __pyx_t_10;
    __pyx_t_10 = 0;
    while (1) {
      __pyx_t_20 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_30, &__pyx_t_4, &__pyx_t_10, &__pyx_t_18, NULL, __pyx_t_11);
      if (unlikely(__pyx_t_20 == 0)) break;
      if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(12, 1147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_18);
      __pyx_t_18 = 0;

      /* "pyarrow/table.pxi":1148
 *             names = []
 *             for k, v in mapping.items():
 *                 names.append(k)             # <<<<<<<<<<<<<<
 *                 arrays.append(asarray(v))
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 */
      __pyx_t_29 = __Pyx_PyList_Append(__pyx_v_names, __pyx_v_k); if (unlikely(__pyx_t_29 == ((int)-1))) __PYX_ERR(12, 1148, __pyx_L1_error)

      /* "pyarrow/table.pxi":1149
 *             for k, v in mapping.items():
 *                 names.append(k)
 *                 arrays.append(asarray(v))             # <<<<<<<<<<<<<<
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 1149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_18 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_1, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_v);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_29 = __Pyx_PyList_Append(__pyx_v_arrays, __pyx_t_18); if (unlikely(__pyx_t_29 == ((int)-1))) __PYX_ERR(12, 1149, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1150
 *                 names.append(k)
 *                 arrays.append(asarray(v))
 *             return Table.from_arrays(arrays, names, metadata=metadata)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_arrays);
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_GIVEREF(__pyx_v_names);
    PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_v_names);
    __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(12, 1150, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_18, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":1114
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_e2);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1153
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_33from_batches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_32from_batches[] = "Table.from_batches(batches, Schema schema=None)\n\n        Construct a Table from a sequence or iterator of Arrow RecordBatches\n\n        Parameters\n        ----------\n        batches : sequence or iterator of RecordBatch\n            Sequence of RecordBatch to be converted, all schemas must be equal\n        schema : Schema, default None\n            If not passed, will be inferred from the first RecordBatch\n\n        Returns\n        -------\n        table : Table\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_33from_batches = {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_33from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_32from_batches};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_33from_batches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_batches = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_batches (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_batches,&__pyx_n_s_schema,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batches)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_batches") < 0)) __PYX_ERR(12, 1153, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_batches = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_batches", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1153, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(12, 1153, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_32from_batches(__pyx_v_batches, __pyx_v_schema);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_32from_batches(PyObject *__pyx_v_batches, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  std::vector<std::shared_ptr< arrow::RecordBatch> >  __pyx_v_c_batches;
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  std::shared_ptr< arrow::Schema>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("from_batches", 0);

  /* "pyarrow/table.pxi":1174
 *             RecordBatch batch
 * 
 *         for batch in batches:             # <<<<<<<<<<<<<<
 *             c_batches.push_back(batch.sp_batch)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_batches)) || PyTuple_CheckExact(__pyx_v_batches)) {
    __pyx_t_1 = __pyx_v_batches; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1174, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1174, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1174, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1174, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1174, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_RecordBatch))))) __PYX_ERR(12, 1174, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_batch, ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1175
 * 
 *         for batch in batches:
 *             c_batches.push_back(batch.sp_batch)             # <<<<<<<<<<<<<<
 * 
 *         if schema is None:
 */
    try {
      __pyx_v_c_batches.push_back(__pyx_v_batch->sp_batch);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(12, 1175, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1174
 *             RecordBatch batch
 * 
 *         for batch in batches:             # <<<<<<<<<<<<<<
 *             c_batches.push_back(batch.sp_batch)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1177
 *             c_batches.push_back(batch.sp_batch)
 * 
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '
 */
  __pyx_t_5 = (((PyObject *)__pyx_v_schema) == Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/table.pxi":1178
 * 
 *         if schema is None:
 *             if c_batches.size() == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 */
    __pyx_t_6 = ((__pyx_v_c_batches.size() == 0) != 0);
    if (unlikely(__pyx_t_6)) {

      /* "pyarrow/table.pxi":1179
 *         if schema is None:
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '             # <<<<<<<<<<<<<<
 *                                  'one RecordBatch')
 *             c_schema = c_batches[0].get().schema()
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__160, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1179, __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(12, 1179, __pyx_L1_error)

      /* "pyarrow/table.pxi":1178
 * 
 *         if schema is None:
 *             if c_batches.size() == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 */
    }

    /* "pyarrow/table.pxi":1181
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 *             c_schema = c_batches[0].get().schema()             # <<<<<<<<<<<<<<
 *         else:
 *             c_schema = schema.sp_schema
 */
    __pyx_v_c_schema = (__pyx_v_c_batches[0]).get()->schema();

    /* "pyarrow/table.pxi":1177
 *             c_batches.push_back(batch.sp_batch)
 * 
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '
 */
    goto __pyx_L5;
  }

  /* "pyarrow/table.pxi":1183
 *             c_schema = c_batches[0].get().schema()
 *         else:
 *             c_schema = schema.sp_schema             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_7 = __pyx_v_schema->sp_schema;
    __pyx_v_c_schema = __pyx_t_7;
  }
  __pyx_L5:;

  /* "pyarrow/table.pxi":1185
 *             c_schema = schema.sp_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CTable.FromRecordBatches(c_schema, c_batches,
 *                                                   &c_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1186
 * 
 *         with nogil:
 *             check_status(CTable.FromRecordBatches(c_schema, c_batches,             # <<<<<<<<<<<<<<
 *                                                   &c_table))
 * 
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status( arrow::Table::FromRecordBatches(__pyx_v_c_schema, __pyx_v_c_batches, (&__pyx_v_c_table))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1186, __pyx_L8_error)
      }

      /* "pyarrow/table.pxi":1185
 *             c_schema = schema.sp_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CTable.FromRecordBatches(c_schema, c_batches,
 *                                                   &c_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L8_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L9:;
      }
  }

  /* "pyarrow/table.pxi":1189
 *                                                   &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def to_batches(self, max_chunksize=None, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1153
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_batch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1191
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def to_batches(self, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Table to list of (contiguous) RecordBatch objects, with maximum
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_35to_batches(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_34to_batches[] = "Table.to_batches(self, max_chunksize=None, **kwargs)\n\n        Convert Table to list of (contiguous) RecordBatch objects, with maximum\n        chunk size\n\n        Parameters\n        ----------\n        max_chunksize : int, default None\n            Maximum size for RecordBatch chunks. Individual chunks may be\n            smaller depending on the chunk layout of individual columns\n\n        Returns\n        -------\n        batches : list of RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_35to_batches(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_max_chunksize = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_batches (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_chunksize,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_chunksize);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "to_batches") < 0)) __PYX_ERR(12, 1191, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_max_chunksize = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_batches", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1191, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.Table.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_34to_batches(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_max_chunksize, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_34to_batches(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs) {
  std::unique_ptr<arrow::TableBatchReader>  __pyx_v_reader;
  int64_t __pyx_v_c_max_chunksize;
  PyObject *__pyx_v_result = 0;
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_v_msg = NULL;
  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_t_6;
  PyObject *__pyx_t_7 = NULL;
  int64_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("to_batches", 0);
  __Pyx_INCREF(__pyx_v_max_chunksize);

  /* "pyarrow/table.pxi":1209
 *             unique_ptr[TableBatchReader] reader
 *             int64_t c_max_chunksize
 *             list result = []             # <<<<<<<<<<<<<<
 *             shared_ptr[CRecordBatch] batch
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1212
 *             shared_ptr[CRecordBatch] batch
 * 
 *         reader.reset(new TableBatchReader(deref(self.table)))             # <<<<<<<<<<<<<<
 * 
 *         if 'chunksize' in kwargs:
 */
  __pyx_v_reader.reset(new arrow::TableBatchReader((*__pyx_v_self->table)));

  /* "pyarrow/table.pxi":1214
 *         reader.reset(new TableBatchReader(deref(self.table)))
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for '
 */
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_chunksize, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 1214, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1215
 * 
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']             # <<<<<<<<<<<<<<
 *             msg = ('The parameter chunksize is deprecated for '
 *                    'pyarrow.Table.to_batches as of 0.15, please use '
 */
    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_u_chunksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_max_chunksize, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1216
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for '             # <<<<<<<<<<<<<<
 *                    'pyarrow.Table.to_batches as of 0.15, please use '
 *                    'the parameter max_chunksize instead')
 */
    __Pyx_INCREF(__pyx_kp_u_The_parameter_chunksize_is_depre);
    __pyx_v_msg = __pyx_kp_u_The_parameter_chunksize_is_depre;

    /* "pyarrow/table.pxi":1219
 *                    'pyarrow.Table.to_batches as of 0.15, please use '
 *                    'the parameter max_chunksize instead')
 *             warnings.warn(msg, FutureWarning)             # <<<<<<<<<<<<<<
 * 
 *         if max_chunksize is not None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1219, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1219, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_msg);
      __Pyx_GIVEREF(__pyx_v_msg);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_msg);
      __Pyx_INCREF(__pyx_builtin_FutureWarning);
      __Pyx_GIVEREF(__pyx_builtin_FutureWarning);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_builtin_FutureWarning);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1214
 *         reader.reset(new TableBatchReader(deref(self.table)))
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for '
 */
  }

  /* "pyarrow/table.pxi":1221
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 *             reader.get().set_chunksize(c_max_chunksize)
 */
  __pyx_t_3 = (__pyx_v_max_chunksize != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1222
 * 
 *         if max_chunksize is not None:
 *             c_max_chunksize = max_chunksize             # <<<<<<<<<<<<<<
 *             reader.get().set_chunksize(c_max_chunksize)
 * 
 */
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_max_chunksize); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 1222, __pyx_L1_error)
    __pyx_v_c_max_chunksize = __pyx_t_8;

    /* "pyarrow/table.pxi":1223
 *         if max_chunksize is not None:
 *             c_max_chunksize = max_chunksize
 *             reader.get().set_chunksize(c_max_chunksize)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __pyx_v_reader.get()->set_chunksize(__pyx_v_c_max_chunksize);

    /* "pyarrow/table.pxi":1221
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 *             reader.get().set_chunksize(c_max_chunksize)
 */
  }

  /* "pyarrow/table.pxi":1225
 *             reader.get().set_chunksize(c_max_chunksize)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(reader.get().ReadNext(&batch))
 */
  while (1) {

    /* "pyarrow/table.pxi":1226
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":1227
 *         while True:
 *             with nogil:
 *                 check_status(reader.get().ReadNext(&batch))             # <<<<<<<<<<<<<<
 * 
 *             if batch.get() == NULL:
 */
          __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_reader.get()->ReadNext((&__pyx_v_batch))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(12, 1227, __pyx_L10_error)
        }

        /* "pyarrow/table.pxi":1226
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L11;
          }
          __pyx_L10_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L11:;
        }
    }

    /* "pyarrow/table.pxi":1229
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 *             if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_2 = ((__pyx_v_batch.get() == NULL) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/table.pxi":1230
 * 
 *             if batch.get() == NULL:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             result.append(pyarrow_wrap_batch(batch))
 */
      goto __pyx_L6_break;

      /* "pyarrow/table.pxi":1229
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 *             if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "pyarrow/table.pxi":1232
 *                 break
 * 
 *             result.append(pyarrow_wrap_batch(batch))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(12, 1232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L6_break:;

  /* "pyarrow/table.pxi":1234
 *             result.append(pyarrow_wrap_batch(batch))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1191
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def to_batches(self, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Table to list of (contiguous) RecordBatch objects, with maximum
 */

  /* 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.lib.Table.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_max_chunksize);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1236
 *         return result
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):             # <<<<<<<<<<<<<<
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_37_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_36_to_pandas[] = "Table._to_pandas(self, options, categories=None, ignore_metadata=False)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_37_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_categories = 0;
  PyObject *__pyx_v_ignore_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,&__pyx_n_s_categories,&__pyx_n_s_ignore_metadata,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_metadata);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(12, 1236, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_options = values[0];
    __pyx_v_categories = values[1];
    __pyx_v_ignore_metadata = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1236, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_36_to_pandas(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_options, __pyx_v_categories, __pyx_v_ignore_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_36_to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_categories, PyObject *__pyx_v_ignore_metadata) {
  PyObject *__pyx_v_table_to_blockmanager = NULL;
  PyObject *__pyx_v_mgr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":1237
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 *         from pyarrow.pandas_compat import table_to_blockmanager             # <<<<<<<<<<<<<<
 *         mgr = table_to_blockmanager(
 *             options, self, categories,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_table_to_blockmanager);
  __Pyx_GIVEREF(__pyx_n_s_table_to_blockmanager);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_table_to_blockmanager);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_table_to_blockmanager); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_to_blockmanager = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1238
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(             # <<<<<<<<<<<<<<
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_options);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_categories);
  __Pyx_GIVEREF(__pyx_v_categories);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_categories);

  /* "pyarrow/table.pxi":1240
 *         mgr = table_to_blockmanager(
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)             # <<<<<<<<<<<<<<
 *         return pandas_api.data_frame(mgr)
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_metadata, __pyx_v_ignore_metadata) < 0) __PYX_ERR(12, 1240, __pyx_L1_error)

  /* "pyarrow/table.pxi":1238
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(             # <<<<<<<<<<<<<<
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_table_to_blockmanager, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_mgr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1241
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)
 *         return pandas_api.data_frame(mgr)             # <<<<<<<<<<<<<<
 * 
 *     def to_pydict(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_data_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_mgr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_mgr);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1241, __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/table.pxi":1236
 *         return result
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):             # <<<<<<<<<<<<<<
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_to_blockmanager);
  __Pyx_XDECREF(__pyx_v_mgr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1243
 *         return pandas_api.data_frame(mgr)
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the Table to a dict or OrderedDict.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_39to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_38to_pydict[] = "Table.to_pydict(self)\n\n        Convert the Table to a dict or OrderedDict.\n\n        Returns\n        -------\n        dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_39to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pydict (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_38to_pydict(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_38to_pydict(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  size_t __pyx_v_i;
  size_t __pyx_v_num_columns;
  PyObject *__pyx_v_entries = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_column = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("to_pydict", 0);

  /* "pyarrow/table.pxi":1253
 *         cdef:
 *             size_t i
 *             size_t num_columns = self.table.num_columns()             # <<<<<<<<<<<<<<
 *             list entries = []
 *             ChunkedArray column
 */
  __pyx_v_num_columns = __pyx_v_self->table->num_columns();

  /* "pyarrow/table.pxi":1254
 *             size_t i
 *             size_t num_columns = self.table.num_columns()
 *             list entries = []             # <<<<<<<<<<<<<<
 *             ChunkedArray column
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1257
 *             ChunkedArray column
 * 
 *         for i in range(num_columns):             # <<<<<<<<<<<<<<
 *             column = self.column(i)
 *             entries.append((self.field(i).name, column.to_pylist()))
 */
  __pyx_t_2 = __pyx_v_num_columns;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/table.pxi":1258
 * 
 *         for i in range(num_columns):
 *             column = self.column(i)             # <<<<<<<<<<<<<<
 *             entries.append((self.field(i).name, column.to_pylist()))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 1258, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_column, ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1259
 *         for i in range(num_columns):
 *             column = self.column(i)
 *             entries.append((self.field(i).name, column.to_pylist()))             # <<<<<<<<<<<<<<
 * 
 *         return ordered_dict(entries)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_column), __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1259, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pyarrow/table.pxi":1261
 *             entries.append((self.field(i).name, column.to_pylist()))
 * 
 *         return ordered_dict(entries)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_entries) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_entries);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1243
 *         return pandas_api.data_frame(mgr)
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the Table to a dict or OrderedDict.
 */

  /* 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_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.to_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_entries);
  __Pyx_XDECREF((PyObject *)__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1264
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the table and its columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_6schema___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6schema___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1272
 *         pyarrow.Schema
 *         """
 *         return pyarrow_wrap_schema(self.table.schema())             # <<<<<<<<<<<<<<
 * 
 *     def field(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->table->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1264
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the table and its columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1274
 *         return pyarrow_wrap_schema(self.table.schema())
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a schema field by its colunm name or numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_41field(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_40field[] = "Table.field(self, i)\n\n        Select a schema field by its colunm name or numeric index.\n\n        Parameters\n        ----------\n        i : int or string\n\n        Returns\n        -------\n        pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_41field(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_40field(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_40field(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/table.pxi":1286
 *         pyarrow.Field
 *         """
 *         return self.schema.field(i)             # <<<<<<<<<<<<<<
 * 
 *     def column(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_i);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1274
 *         return pyarrow_wrap_schema(self.table.schema())
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a schema field by its colunm name or numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1288
 *         return self.schema.field(i)
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its column name, or numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_43column(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_42column[] = "Table.column(self, i)\n\n        Select a column by its column name, or numeric index.\n\n        Parameters\n        ----------\n        i : int or string\n\n        Returns\n        -------\n        pyarrow.ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_43column(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("column (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_42column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_42column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_v_field_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("column", 0);

  /* "pyarrow/table.pxi":1300
 *         pyarrow.ChunkedArray
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 1300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/table.pxi":1301
 *         """
 *         if isinstance(i, six.string_types):
 *             field_index = self.schema.get_field_index(i)             # <<<<<<<<<<<<<<
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in table".format(i))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_field_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_field_index = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":1302
 *         if isinstance(i, six.string_types):
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in table".format(i))
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_field_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1302, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(12, 1302, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":1303
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in table".format(i))             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._column(field_index)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_does_not_exist_in_table, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(12, 1303, __pyx_L1_error)

      /* "pyarrow/table.pxi":1302
 *         if isinstance(i, six.string_types):
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in table".format(i))
 *             else:
 */
    }

    /* "pyarrow/table.pxi":1305
 *                 raise KeyError("Column {} does not exist in table".format(i))
 *             else:
 *                 return self._column(field_index)             # <<<<<<<<<<<<<<
 *         elif isinstance(i, six.integer_types):
 *             return self._column(i)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_field_index) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_field_index);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "pyarrow/table.pxi":1300
 *         pyarrow.ChunkedArray
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 */
  }

  /* "pyarrow/table.pxi":1306
 *             else:
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._column(i)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(12, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/table.pxi":1307
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):
 *             return self._column(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Index must either be string or integer")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1306
 *             else:
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._column(i)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":1309
 *             return self._column(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _column(self, int i):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1309, __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(12, 1309, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":1288
 *         return self.schema.field(i)
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its column name, or numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Table.column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_field_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1311
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_45_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_44_column[] = "Table._column(self, int i)\n\n        Select a column by its numeric index.\n\n        Parameters\n        ----------\n        i : int\n\n        Returns\n        -------\n        pyarrow.ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_45_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 1311, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table._column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_44_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_44_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_index;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_column", 0);

  /* "pyarrow/table.pxi":1323
 *         pyarrow.ChunkedArray
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)             # <<<<<<<<<<<<<<
 *         cdef ChunkedArray result = pyarrow_wrap_chunked_array(
 *             self.table.column(index))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 1323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(12, 1323, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_3);

  /* "pyarrow/table.pxi":1324
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)
 *         cdef ChunkedArray result = pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *             self.table.column(index))
 *         result._name = self.schema[index].name
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_self->table->column(__pyx_v_index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 1324, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1326
 *         cdef ChunkedArray result = pyarrow_wrap_chunked_array(
 *             self.table.column(index))
 *         result._name = self.schema[index].name             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->_name);
  __Pyx_DECREF(__pyx_v_result->_name);
  __pyx_v_result->_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1327
 *             self.table.column(index))
 *         result._name = self.schema[index].name
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def itercolumns(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1311
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table._column", __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;
}
static PyObject *__pyx_gb_7pyarrow_3lib_5Table_48generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":1329
 *         return result
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_47itercolumns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_46itercolumns[] = "Table.itercolumns(self)\n\n        Iterator over all columns in their numerical order\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_47itercolumns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("itercolumns (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_46itercolumns(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_46itercolumns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("itercolumns", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_itercolumns(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_itercolumns, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(12, 1329, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_5Table_48generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_itercolumns, __pyx_n_s_Table_itercolumns, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(12, 1329, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.itercolumns", __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_3lib_5Table_48generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("itercolumns", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(12, 1329, __pyx_L1_error)

  /* "pyarrow/table.pxi":1333
 *         Iterator over all columns in their numerical order
 *         """
 *         for i in range(self.num_columns):             # <<<<<<<<<<<<<<
 *             yield self._column(i)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1333, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(12, 1333, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1333, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(12, 1333, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1333, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1333, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":1334
 *         """
 *         for i in range(self.num_columns):
 *             yield self._column(i)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(12, 1334, __pyx_L1_error)

    /* "pyarrow/table.pxi":1333
 *         Iterator over all columns in their numerical order
 *         """
 *         for i in range(self.num_columns):             # <<<<<<<<<<<<<<
 *             yield self._column(i)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/table.pxi":1329
 *         return result
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("itercolumns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1337
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_7columns___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_7columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_9genexpr12__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1345
 *         list of pa.ChunkedArray
 *         """
 *         return [self._column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1345, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1345, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1345, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1345, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1345, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 1345, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1345, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 1345, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1345, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 1345, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1345, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr12__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr12__pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1345, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(12, 1345, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i); __pyx_9genexpr12__pyx_v_i = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i); __pyx_9genexpr12__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1337
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1348
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns in this table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11num_columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11num_columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_11num_columns___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1356
 *         int
 *         """
 *         return self.table.num_columns()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->table->num_columns()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1348
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns in this table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.num_columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1359
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows in this table.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1370
 *         int
 *         """
 *         return self.table.num_rows()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->table->num_rows()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1359
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows in this table.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1372
 *         return self.table.num_rows()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_rows
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_50__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_50__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_49__len__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Table_49__len__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/table.pxi":1373
 * 
 *     def __len__(self):
 *         return self.num_rows             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1372
 *         return self.table.num_rows()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_rows
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1376
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """
 *         Dimensions of the table: (#rows, #columns)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1384
 *         (int, int)
 *         """
 *         return (self.num_rows, self.num_columns)             # <<<<<<<<<<<<<<
 * 
 *     def add_column(self, int i, field_, column):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1376
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """
 *         Dimensions of the table: (#rows, #columns)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1386
 *         return (self.num_rows, self.num_columns)
 * 
 *     def add_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Add column to Table at position. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_52add_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_51add_column[] = "Table.add_column(self, int i, field_, column)\n\n        Add column to Table at position. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_52add_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  PyObject *__pyx_v_field_ = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_column (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field_3,&__pyx_n_s_column,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_3)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_column", 1, 3, 3, 1); __PYX_ERR(12, 1386, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_column", 1, 3, 3, 2); __PYX_ERR(12, 1386, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_column") < 0)) __PYX_ERR(12, 1386, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 1386, __pyx_L3_error)
    __pyx_v_field_ = values[1];
    __pyx_v_column = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_column", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1386, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.add_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_51add_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_i, __pyx_v_field_, __pyx_v_column);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_51add_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_c_field = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_c_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("add_column", 0);

  /* "pyarrow/table.pxi":1395
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1396
 * 
 *         if isinstance(column, ChunkedArray):
 *             c_arr = column             # <<<<<<<<<<<<<<
 *         else:
 *             c_arr = chunked_array(column)
 */
    if (!(likely(((__pyx_v_column) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 1396, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_column;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1395
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":1398
 *             c_arr = column
 *         else:
 *             c_arr = chunked_array(column)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(field_, Field):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_column) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_column);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 1398, __pyx_L1_error)
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":1400
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1401
 * 
 *         if isinstance(field_, Field):
 *             c_field = field_             # <<<<<<<<<<<<<<
 *         else:
 *             c_field = field(field_, c_arr.type)
 */
    if (!(likely(((__pyx_v_field_) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(12, 1401, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_field_;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1400
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":1403
 *             c_field = field_
 *         else:
 *             c_field = field(field_, c_arr.type)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_arr), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1403, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1403, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 1403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_field_);
      __Pyx_GIVEREF(__pyx_v_field_);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_field_);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(12, 1403, __pyx_L1_error)
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":1405
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.AddColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1406
 * 
 *         with nogil:
 *             check_status(self.table.AddColumn(i, c_field.sp_field,             # <<<<<<<<<<<<<<
 *                                               c_arr.sp_chunked_array,
 *                                               &c_table))
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->AddColumn(__pyx_v_i, __pyx_v_c_field->sp_field, __pyx_v_c_arr->sp_chunked_array, (&__pyx_v_c_table))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(12, 1406, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1405
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.AddColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1410
 *                                               &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def append_column(self, field_, column):
 */
  __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(12, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1386
 *         return (self.num_rows, self.num_columns)
 * 
 *     def add_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Add column to Table at position. Returns new table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.add_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c_field);
  __Pyx_XDECREF((PyObject *)__pyx_v_c_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1412
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def append_column(self, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Append column at end of columns. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_54append_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_53append_column[] = "Table.append_column(self, field_, column)\n\n        Append column at end of columns. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_54append_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_field_ = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append_column (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field_3,&__pyx_n_s_column,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_3)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("append_column", 1, 2, 2, 1); __PYX_ERR(12, 1412, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append_column") < 0)) __PYX_ERR(12, 1412, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_field_ = values[0];
    __pyx_v_column = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("append_column", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1412, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.append_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_53append_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_field_, __pyx_v_column);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_53append_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_column) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("append_column", 0);

  /* "pyarrow/table.pxi":1416
 *         Append column at end of columns. Returns new table
 *         """
 *         return self.add_column(self.num_columns, field_, column)             # <<<<<<<<<<<<<<
 * 
 *     def remove_column(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_column); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_field_, __pyx_v_column};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1416, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_field_, __pyx_v_column};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1416, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_field_);
    __Pyx_GIVEREF(__pyx_v_field_);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_field_);
    __Pyx_INCREF(__pyx_v_column);
    __Pyx_GIVEREF(__pyx_v_column);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_column);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1412
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def append_column(self, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Append column at end of columns. Returns new table
 */

  /* 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.lib.Table.append_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1418
 *         return self.add_column(self.num_columns, field_, column)
 * 
 *     def remove_column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Create new Table with the indicated column removed
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_56remove_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_55remove_column[] = "Table.remove_column(self, int i)\n\n        Create new Table with the indicated column removed\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_56remove_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_column (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 1418, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.remove_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_55remove_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_55remove_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("remove_column", 0);

  /* "pyarrow/table.pxi":1424
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RemoveColumn(i, &c_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1425
 * 
 *         with nogil:
 *             check_status(self.table.RemoveColumn(i, &c_table))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->RemoveColumn(__pyx_v_i, (&__pyx_v_c_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 1425, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1424
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RemoveColumn(i, &c_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":1427
 *             check_status(self.table.RemoveColumn(i, &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def set_column(self, int i, field_, column):
 */
  __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(12, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1418
 *         return self.add_column(self.num_columns, field_, column)
 * 
 *     def remove_column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Create new Table with the indicated column removed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Table.remove_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1429
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def set_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Replace column in Table at position. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_58set_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_57set_column[] = "Table.set_column(self, int i, field_, column)\n\n        Replace column in Table at position. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_58set_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  PyObject *__pyx_v_field_ = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_column (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field_3,&__pyx_n_s_column,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_3)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_column", 1, 3, 3, 1); __PYX_ERR(12, 1429, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_column", 1, 3, 3, 2); __PYX_ERR(12, 1429, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_column") < 0)) __PYX_ERR(12, 1429, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(12, 1429, __pyx_L3_error)
    __pyx_v_field_ = values[1];
    __pyx_v_column = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_column", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1429, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.set_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_57set_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_i, __pyx_v_field_, __pyx_v_column);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_57set_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_c_field = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_c_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("set_column", 0);

  /* "pyarrow/table.pxi":1438
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1439
 * 
 *         if isinstance(column, ChunkedArray):
 *             c_arr = column             # <<<<<<<<<<<<<<
 *         else:
 *             c_arr = chunked_array(column)
 */
    if (!(likely(((__pyx_v_column) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 1439, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_column;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1438
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":1441
 *             c_arr = column
 *         else:
 *             c_arr = chunked_array(column)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(field_, Field):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_column) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_column);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(12, 1441, __pyx_L1_error)
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":1443
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1444
 * 
 *         if isinstance(field_, Field):
 *             c_field = field_             # <<<<<<<<<<<<<<
 *         else:
 *             c_field = field(field_, c_arr.type)
 */
    if (!(likely(((__pyx_v_field_) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(12, 1444, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_field_;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1443
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":1446
 *             c_field = field_
 *         else:
 *             c_field = field(field_, c_arr.type)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_arr), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1446, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1446, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 1446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_field_);
      __Pyx_GIVEREF(__pyx_v_field_);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_field_);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(12, 1446, __pyx_L1_error)
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":1448
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.SetColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1449
 * 
 *         with nogil:
 *             check_status(self.table.SetColumn(i, c_field.sp_field,             # <<<<<<<<<<<<<<
 *                                               c_arr.sp_chunked_array,
 *                                               &c_table))
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->SetColumn(__pyx_v_i, __pyx_v_c_field->sp_field, __pyx_v_c_arr->sp_chunked_array, (&__pyx_v_c_table))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(12, 1449, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1448
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.SetColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1453
 *                                               &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __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(12, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1429
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def set_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Replace column in Table at position. Returns new table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.set_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c_field);
  __Pyx_XDECREF((PyObject *)__pyx_v_c_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1456
 * 
 *     @property
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Names of the table's columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_12column_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_12column_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_12column_names___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12column_names___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  std::vector<std::string>  __pyx_v_names;
  std::string __pyx_9genexpr13__pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::string> ::iterator __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1460
 *         Names of the table's columns
 *         """
 *         names = self.table.ColumnNames()             # <<<<<<<<<<<<<<
 *         return [frombytes(name) for name in names]
 * 
 */
  __pyx_v_names = __pyx_v_self->table->ColumnNames();

  /* "pyarrow/table.pxi":1461
 *         """
 *         names = self.table.ColumnNames()
 *         return [frombytes(name) for name in names]             # <<<<<<<<<<<<<<
 * 
 *     def rename_columns(self, names):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_names.begin();
    for (;;) {
      if (!(__pyx_t_2 != __pyx_v_names.end())) break;
      __pyx_t_3 = *__pyx_t_2;
      ++__pyx_t_2;
      __pyx_9genexpr13__pyx_v_name = __pyx_t_3;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_9genexpr13__pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(12, 1461, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1456
 * 
 *     @property
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Names of the table's columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.column_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1463
 *         return [frombytes(name) for name in names]
 * 
 *     def rename_columns(self, names):             # <<<<<<<<<<<<<<
 *         """
 *         Create new table with columns renamed to provided names
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_60rename_columns(PyObject *__pyx_v_self, PyObject *__pyx_v_names); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_59rename_columns[] = "Table.rename_columns(self, names)\n\n        Create new table with columns renamed to provided names\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_60rename_columns(PyObject *__pyx_v_self, PyObject *__pyx_v_names) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rename_columns (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_59rename_columns(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_names));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_59rename_columns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_names) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  std::vector<std::string>  __pyx_v_c_names;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("rename_columns", 0);

  /* "pyarrow/table.pxi":1471
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
    __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1471, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1471, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1471, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1471, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1472
 * 
 *         for name in names:
 *             c_names.push_back(tobytes(name))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 1472, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    try {
      __pyx_v_c_names.push_back(__pyx_t_7);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(12, 1472, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1471
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1474
 *             c_names.push_back(tobytes(name))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RenameColumns(c_names, &c_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1475
 * 
 *         with nogil:
 *             check_status(self.table.RenameColumns(c_names, &c_table))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->RenameColumns(__pyx_v_c_names, (&__pyx_v_c_table))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1475, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1474
 *             c_names.push_back(tobytes(name))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RenameColumns(c_names, &c_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1477
 *             check_status(self.table.RenameColumns(c_names, &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def drop(self, columns):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1463
 *         return [frombytes(name) for name in names]
 * 
 *     def rename_columns(self, names):             # <<<<<<<<<<<<<<
 *         """
 *         Create new table with columns renamed to provided names
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.rename_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1479
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def drop(self, columns):             # <<<<<<<<<<<<<<
 *         """
 *         Drop one or more columns and return a new table.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_62drop(PyObject *__pyx_v_self, PyObject *__pyx_v_columns); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_61drop[] = "Table.drop(self, columns)\n\n        Drop one or more columns and return a new table.\n\n        columns: list of str\n\n        Returns pa.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_62drop(PyObject *__pyx_v_self, PyObject *__pyx_v_columns) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drop (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_61drop(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_columns));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_61drop(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_columns) {
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_v_col = NULL;
  PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("drop", 0);

  /* "pyarrow/table.pxi":1487
 *         Returns pa.Table
 *         """
 *         indices = []             # <<<<<<<<<<<<<<
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1488
 *         """
 *         indices = []
 *         for col in columns:             # <<<<<<<<<<<<<<
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:
 */
  if (likely(PyList_CheckExact(__pyx_v_columns)) || PyTuple_CheckExact(__pyx_v_columns)) {
    __pyx_t_1 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1488, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1488, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1488, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1488, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1489
 *         indices = []
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 raise KeyError("Column {!r} not found".format(col))
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_field_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_col) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_col);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1490
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {!r} not found".format(col))
 *             indices.append(idx)
 */
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_idx, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(12, 1490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_7)) {

      /* "pyarrow/table.pxi":1491
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:
 *                 raise KeyError("Column {!r} not found".format(col))             # <<<<<<<<<<<<<<
 *             indices.append(idx)
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_r_not_found, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_col) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_col);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(12, 1491, __pyx_L1_error)

      /* "pyarrow/table.pxi":1490
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {!r} not found".format(col))
 *             indices.append(idx)
 */
    }

    /* "pyarrow/table.pxi":1492
 *             if idx == -1:
 *                 raise KeyError("Column {!r} not found".format(col))
 *             indices.append(idx)             # <<<<<<<<<<<<<<
 * 
 *         indices.sort()
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_indices, __pyx_v_idx); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1492, __pyx_L1_error)

    /* "pyarrow/table.pxi":1488
 *         """
 *         indices = []
 *         for col in columns:             # <<<<<<<<<<<<<<
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1494
 *             indices.append(idx)
 * 
 *         indices.sort()             # <<<<<<<<<<<<<<
 *         indices.reverse()
 * 
 */
  __pyx_t_8 = PyList_Sort(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1494, __pyx_L1_error)

  /* "pyarrow/table.pxi":1495
 * 
 *         indices.sort()
 *         indices.reverse()             # <<<<<<<<<<<<<<
 * 
 *         table = self
 */
  __pyx_t_8 = PyList_Reverse(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1495, __pyx_L1_error)

  /* "pyarrow/table.pxi":1497
 *         indices.reverse()
 * 
 *         table = self             # <<<<<<<<<<<<<<
 *         for idx in indices:
 *             table = table.remove_column(idx)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_v_table = ((PyObject *)__pyx_v_self);

  /* "pyarrow/table.pxi":1498
 * 
 *         table = self
 *         for idx in indices:             # <<<<<<<<<<<<<<
 *             table = table.remove_column(idx)
 * 
 */
  __pyx_t_1 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1498, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1499
 *         table = self
 *         for idx in indices:
 *             table = table.remove_column(idx)             # <<<<<<<<<<<<<<
 * 
 *         return table
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_remove_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_idx) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_idx);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_table, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1498
 * 
 *         table = self
 *         for idx in indices:             # <<<<<<<<<<<<<<
 *             table = table.remove_column(idx)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1501
 *             table = table.remove_column(idx)
 * 
 *         return table             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = __pyx_v_table;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1479
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def drop(self, columns):             # <<<<<<<<<<<<<<
 *         """
 *         Drop one or more columns and return a new table.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.drop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1504
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_143_reconstruct_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_142_reconstruct_table[] = "_reconstruct_table(arrays, schema)\n\n    Internal: reconstruct pa.Table from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_143_reconstruct_table = {"_reconstruct_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_143_reconstruct_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_142_reconstruct_table};
static PyObject *__pyx_pw_7pyarrow_3lib_143_reconstruct_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reconstruct_table (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_schema,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_reconstruct_table", 1, 2, 2, 1); __PYX_ERR(12, 1504, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_reconstruct_table") < 0)) __PYX_ERR(12, 1504, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arrays = values[0];
    __pyx_v_schema = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_reconstruct_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1504, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._reconstruct_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_142_reconstruct_table(__pyx_self, __pyx_v_arrays, __pyx_v_schema);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_142_reconstruct_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_schema) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_reconstruct_table", 0);

  /* "pyarrow/table.pxi":1508
 *     Internal: reconstruct pa.Table from pickled components.
 *     """
 *     return Table.from_arrays(arrays, schema=schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arrays);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1508, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1504
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */

  /* 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.lib._reconstruct_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1511
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_145record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_144record_batch[] = "record_batch(data, names=None, schema=None, metadata=None)\n\n    Create a pyarrow.RecordBatch from another Python data structure or sequence\n    of arrays\n\n    Parameters\n    ----------\n    data : pandas.DataFrame, dict, list\n        A DataFrame, mapping of strings to Arrays or Python lists, or list of\n        arrays or chunked arrays\n    names : list, default None\n        Column names if list of arrays passed as data. Mutually exclusive with\n        'schema' argument\n    schema : Schema, default None\n        The expected schema of the RecordBatch. If not passed, will be inferred\n        from the data. Mutually exclusive with 'names' argument\n    metadata : dict or Mapping, default None\n        Optional metadata for the schema (if schema not passed).\n\n    Returns\n    -------\n    RecordBatch\n\n    See Also\n    --------\n    RecordBatch.from_arrays, RecordBatch.from_pandas, Table.from_pydict\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_145record_batch = {"record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_145record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_144record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_145record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("record_batch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "record_batch") < 0)) __PYX_ERR(12, 1511, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("record_batch", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1511, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_144record_batch(__pyx_self, __pyx_v_data, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_144record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __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;
  __Pyx_RefNannySetupContext("record_batch", 0);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_INCREF(__pyx_v_schema);

  /* "pyarrow/table.pxi":1539
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_names, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_schema == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1540
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names             # <<<<<<<<<<<<<<
 *         names = None
 * 
 */
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_DECREF_SET(__pyx_v_schema, __pyx_v_names);

    /* "pyarrow/table.pxi":1541
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names
 *         names = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(data, (list, tuple)):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_names, Py_None);

    /* "pyarrow/table.pxi":1539
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  }

  /* "pyarrow/table.pxi":1543
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_data); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = PyTuple_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1544
 * 
 *     if isinstance(data, (list, tuple)):
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                        metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(12, 1544, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1544, __pyx_L1_error)

    /* "pyarrow/table.pxi":1545
 *     if isinstance(data, (list, tuple)):
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)             # <<<<<<<<<<<<<<
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 *         return RecordBatch.from_pandas(data, schema=schema)
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(12, 1544, __pyx_L1_error)

    /* "pyarrow/table.pxi":1544
 * 
 *     if isinstance(data, (list, tuple)):
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                        metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1543
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 */
  }

  /* "pyarrow/table.pxi":1546
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pandas_api); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_7); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 1546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1547
 *                                        metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 *         return RecordBatch.from_pandas(data, schema=schema)             # <<<<<<<<<<<<<<
 *     else:
 *         return TypeError("Expected pandas DataFrame or python dictionary")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_data);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1547, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1546
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 */
  }

  /* "pyarrow/table.pxi":1549
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 *         return TypeError("Expected pandas DataFrame or python dictionary")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":1511
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1552
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_147table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_146table[] = "table(data, names=None, schema=None, metadata=None)\n\n    Create a pyarrow.Table from another Python data structure or sequence of\n    arrays\n\n    Parameters\n    ----------\n    data : pandas.DataFrame, dict, list\n        A DataFrame, mapping of strings to Arrays or Python lists, or list of\n        arrays or chunked arrays.\n    names : list, default None\n        Column names if list of arrays passed as data. Mutually exclusive with\n        'schema' argument.\n    schema : Schema, default None\n        The expected schema of the Arrow Table. If not passed, will be inferred\n        from the data. Mutually exclusive with 'names' argument.\n        If passed, the output will have exactly this schema (raising an error\n        when columns are not found in the data and ignoring additional data not\n        specified in the schema, when data is a dict or DataFrame).\n    metadata : dict or Mapping, default None\n        Optional metadata for the schema (if schema not passed).\n\n    Returns\n    -------\n    Table\n\n    See Also\n    --------\n    Table.from_arrays, Table.from_pandas, Table.from_pydict\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_147table = {"table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_147table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_146table};
static PyObject *__pyx_pw_7pyarrow_3lib_147table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "table") < 0)) __PYX_ERR(12, 1552, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("table", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1552, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_146table(__pyx_self, __pyx_v_data, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_146table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __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;
  __Pyx_RefNannySetupContext("table", 0);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_INCREF(__pyx_v_schema);

  /* "pyarrow/table.pxi":1583
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_names, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_schema == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1584
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names             # <<<<<<<<<<<<<<
 *         names = None
 * 
 */
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_DECREF_SET(__pyx_v_schema, __pyx_v_names);

    /* "pyarrow/table.pxi":1585
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names
 *         names = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(data, (list, tuple)):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_names, Py_None);

    /* "pyarrow/table.pxi":1583
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  }

  /* "pyarrow/table.pxi":1587
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_data); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = PyTuple_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1588
 * 
 *     if isinstance(data, (list, tuple)):
 *         return Table.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(12, 1588, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1588, __pyx_L1_error)

    /* "pyarrow/table.pxi":1589
 *     if isinstance(data, (list, tuple)):
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)             # <<<<<<<<<<<<<<
 *     elif isinstance(data, dict):
 *         if names is not None:
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(12, 1588, __pyx_L1_error)

    /* "pyarrow/table.pxi":1588
 * 
 *     if isinstance(data, (list, tuple)):
 *         return Table.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1587
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 */
  }

  /* "pyarrow/table.pxi":1590
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             raise ValueError(
 */
  __pyx_t_2 = PyDict_Check(__pyx_v_data); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1591
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' argument is not valid when passing a dictionary")
 */
    __pyx_t_1 = (__pyx_v_names != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":1592
 *     elif isinstance(data, dict):
 *         if names is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 */
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1592, __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(12, 1592, __pyx_L1_error)

      /* "pyarrow/table.pxi":1591
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' argument is not valid when passing a dictionary")
 */
    }

    /* "pyarrow/table.pxi":1594
 *             raise ValueError(
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)             # <<<<<<<<<<<<<<
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 *         if names is not None or metadata is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_pydict); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_data);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1594, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(12, 1594, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1590
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             raise ValueError(
 */
  }

  /* "pyarrow/table.pxi":1595
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):             # <<<<<<<<<<<<<<
 *         if names is not None or metadata is not None:
 *             raise ValueError(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pandas_api); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pd); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 1595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1596
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 *         if names is not None or metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' and 'metadata' arguments are not valid when "
 */
    __pyx_t_2 = (__pyx_v_names != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_metadata != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L11_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":1597
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 *         if names is not None or metadata is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' and 'metadata' arguments are not valid when "
 *                 "passing a pandas DataFrame")
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1597, __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(12, 1597, __pyx_L1_error)

      /* "pyarrow/table.pxi":1596
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 *         if names is not None or metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' and 'metadata' arguments are not valid when "
 */
    }

    /* "pyarrow/table.pxi":1600
 *                 "The 'names' and 'metadata' arguments are not valid when "
 *                 "passing a pandas DataFrame")
 *         return Table.from_pandas(data, schema=schema)             # <<<<<<<<<<<<<<
 *     else:
 *         return TypeError("Expected pandas DataFrame or python dictionary")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1600, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1595
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif isinstance(data, _pandas_api.pd.DataFrame):             # <<<<<<<<<<<<<<
 *         if names is not None or metadata is not None:
 *             raise ValueError(
 */
  }

  /* "pyarrow/table.pxi":1602
 *         return Table.from_pandas(data, schema=schema)
 *     else:
 *         return TypeError("Expected pandas DataFrame or python dictionary")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":1552
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1605
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_149concat_tables(PyObject *__pyx_self, PyObject *__pyx_v_tables); /*proto*/
static char __pyx_doc_7pyarrow_3lib_148concat_tables[] = "concat_tables(tables)\n\n    Perform zero-copy concatenation of pyarrow.Table objects. Raises exception\n    if all of the Table schemas are not the same\n\n    Parameters\n    ----------\n    tables : iterable of pyarrow.Table objects\n    output_name : string, default None\n      A name for the output table, if any\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_149concat_tables = {"concat_tables", (PyCFunction)__pyx_pw_7pyarrow_3lib_149concat_tables, METH_O, __pyx_doc_7pyarrow_3lib_148concat_tables};
static PyObject *__pyx_pw_7pyarrow_3lib_149concat_tables(PyObject *__pyx_self, PyObject *__pyx_v_tables) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat_tables (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_148concat_tables(__pyx_self, ((PyObject *)__pyx_v_tables));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_148concat_tables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tables) {
  std::vector<std::shared_ptr< arrow::Table> >  __pyx_v_c_tables;
  std::shared_ptr< arrow::Table>  __pyx_v_c_result;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("concat_tables", 0);

  /* "pyarrow/table.pxi":1621
 *         Table table
 * 
 *     for table in tables:             # <<<<<<<<<<<<<<
 *         c_tables.push_back(table.sp_table)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_tables)) || PyTuple_CheckExact(__pyx_v_tables)) {
    __pyx_t_1 = __pyx_v_tables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1621, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1621, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1621, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1621, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Table))))) __PYX_ERR(12, 1621, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_table, ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1622
 * 
 *     for table in tables:
 *         c_tables.push_back(table.sp_table)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    try {
      __pyx_v_c_tables.push_back(__pyx_v_table->sp_table);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(12, 1622, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1621
 *         Table table
 * 
 *     for table in tables:             # <<<<<<<<<<<<<<
 *         c_tables.push_back(table.sp_table)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1624
 *         c_tables.push_back(table.sp_table)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConcatenateTables(c_tables, &c_result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1625
 * 
 *     with nogil:
 *         check_status(ConcatenateTables(c_tables, &c_result))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_table(c_result)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::ConcatenateTables(__pyx_v_c_tables, (&__pyx_v_c_result))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(12, 1625, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1624
 *         c_tables.push_back(table.sp_table)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConcatenateTables(c_tables, &c_result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1627
 *         check_status(ConcatenateTables(c_tables, &c_result))
 * 
 *     return pyarrow_wrap_table(c_result)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1605
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.concat_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":24
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Tensor's constructor directly, use one "
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Tensor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Tensor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor___init__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Tensor___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/tensor.pxi":25
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Tensor's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 25, __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(13, 25, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":24
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Tensor's constructor directly, use one "
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":28
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()
 */

static void __pyx_f_7pyarrow_3lib_6Tensor_init(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, std::shared_ptr< arrow::Tensor>  const &__pyx_v_sp_tensor) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/tensor.pxi":29
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):
 *         self.sp_tensor = sp_tensor             # <<<<<<<<<<<<<<
 *         self.tp = sp_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 */
  __pyx_v_self->sp_tensor = __pyx_v_sp_tensor;

  /* "pyarrow/tensor.pxi":30
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 * 
 */
  __pyx_v_self->tp = __pyx_v_sp_tensor.get();

  /* "pyarrow/tensor.pxi":31
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.tp.type())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->tp->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":28
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.Tensor.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/tensor.pxi":33
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.Tensor>
 * type: {0.type}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_2__repr__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_2__repr__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/tensor.pxi":34
 * 
 *     def __repr__(self):
 *         return """<pyarrow.Tensor>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/tensor.pxi":37
 * type: {0.type}
 * shape: {0.shape}
 * strides: {0.strides}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Tensor_type_0_type_shap, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 37, __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/tensor.pxi":33
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.Tensor>
 * type: {0.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.lib.Tensor.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_4from_numpy[] = "Tensor.from_numpy(obj, dim_names=None)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_6Tensor_5from_numpy = {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Tensor_4from_numpy};
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_numpy") < 0)) __PYX_ERR(13, 40, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 40, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Tensor.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4from_numpy(__pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4from_numpy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  std::vector<std::string>  __pyx_v_c_dim_names;
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  std::string __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_numpy", 0);

  /* "pyarrow/tensor.pxi":45
 *             shared_ptr[CTensor] ctensor
 * 
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_1 = (__pyx_v_dim_names != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":46
 * 
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_3 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 46, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 46, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 46, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 46, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 46, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 46, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pyarrow/tensor.pxi":47
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         check_status(NdarrayToTensor(c_default_memory_pool(), obj,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 47, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_9);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 47, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":46
 * 
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/tensor.pxi":45
 *             shared_ptr[CTensor] ctensor
 * 
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":49
 *                 c_dim_names.push_back(tobytes(x))
 * 
 *         check_status(NdarrayToTensor(c_default_memory_pool(), obj,             # <<<<<<<<<<<<<<
 *                                      c_dim_names, &ctensor))
 *         return pyarrow_wrap_tensor(ctensor)
 */
  __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarrayToTensor( arrow::default_memory_pool(), __pyx_v_obj, __pyx_v_c_dim_names, (&__pyx_v_ctensor))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(13, 49, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":51
 *         check_status(NdarrayToTensor(c_default_memory_pool(), obj,
 *                                      c_dim_names, &ctensor))
 *         return pyarrow_wrap_tensor(ctensor)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_ctensor); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":53
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to numpy.ndarray with zero copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_6to_numpy[] = "Tensor.to_numpy(self)\n\n        Convert arrow::Tensor to numpy.ndarray with zero copy\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_6to_numpy(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_6to_numpy(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/tensor.pxi":59
 *         cdef PyObject* out
 * 
 *         check_status(TensorToNdarray(self.sp_tensor, self, &out))             # <<<<<<<<<<<<<<
 *         return PyObject_to_object(out)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::TensorToNdarray(__pyx_v_self->sp_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 59, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":60
 * 
 *         check_status(TensorToNdarray(self.sp_tensor, self, &out))
 *         return PyObject_to_object(out)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Tensor other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":53
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to numpy.ndarray with zero copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":62
 *         return PyObject_to_object(out)
 * 
 *     def equals(self, Tensor other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if the tensors contains exactly equal data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_8equals[] = "Tensor.equals(self, Tensor other)\n\n        Return true if the tensors contains exactly equal data\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Tensor, 1, "other", 0))) __PYX_ERR(13, 62, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_8equals(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_8equals(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/tensor.pxi":66
 *         Return true if the tensors contains exactly equal data
 *         """
 *         return self.tp.Equals(deref(other.tp))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->tp->Equals((*__pyx_v_other->tp))); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":62
 *         return PyObject_to_object(out)
 * 
 *     def equals(self, Tensor other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if the tensors contains exactly equal data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":68
 *         return self.tp.Equals(deref(other.tp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Tensor):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_10__eq__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10__eq__(struct __pyx_obj_7pyarrow_3lib_Tensor *__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/tensor.pxi":69
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_Tensor); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":70
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/tensor.pxi":69
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/tensor.pxi":72
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def dim_name(self, i):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/tensor.pxi":68
 *         return self.tp.Equals(deref(other.tp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Tensor):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":74
 *             return NotImplemented
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.tp.dim_name(i))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_12dim_name[] = "Tensor.dim_name(self, i)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dim_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_12dim_name(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_12dim_name(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("dim_name", 0);

  /* "pyarrow/tensor.pxi":75
 * 
 *     def dim_name(self, i):
 *         return frombytes(self.tp.dim_name(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 75, __pyx_L1_error)
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->tp->dim_name(__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 75, __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/tensor.pxi":74
 *             return NotImplemented
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.tp.dim_name(i))
 * 
 */

  /* 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_AddTraceback("pyarrow.lib.Tensor.dim_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":78
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.tp.dim_names())]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9dim_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9dim_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_9dim_names___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_9genexpr14__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":79
 *     @property
 *     def dim_names(self):
 *         return [frombytes(x) for x in tuple(self.tp.dim_names())]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 79, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_self->tp->dim_names()); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 79, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 79, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 79, __pyx_L5_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_9genexpr14__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr14__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_x); __pyx_9genexpr14__pyx_v_x = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_x); __pyx_9genexpr14__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":78
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.tp.dim_names())]
 * 
 */

  /* 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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.dim_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":82
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_mutable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":83
 *     @property
 *     def is_mutable(self):
 *         return self.tp.is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->tp->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":82
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_mutable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":86
 * 
 *     @property
 *     def is_contiguous(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_contiguous()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13is_contiguous_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13is_contiguous_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_13is_contiguous___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_13is_contiguous___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":87
 *     @property
 *     def is_contiguous(self):
 *         return self.tp.is_contiguous()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->tp->is_contiguous()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":86
 * 
 *     @property
 *     def is_contiguous(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_contiguous()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.is_contiguous.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":90
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.tp.ndim()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4ndim___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":91
 *     @property
 *     def ndim(self):
 *         return self.tp.ndim()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->tp->ndim()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":90
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.tp.ndim()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":94
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.tp.size()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4size___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4size___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":95
 *     @property
 *     def size(self):
 *         return self.tp.size()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->tp->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":94
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.tp.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":98
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.tp.shape())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":100
 *     def shape(self):
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.tp.shape())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->tp->shape()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 100, __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/tensor.pxi":98
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.tp.shape())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":103
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         return tuple(self.tp.strides())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7strides_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_7strides___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_7strides___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":104
 *     @property
 *     def strides(self):
 *         return tuple(self.tp.strides())             # <<<<<<<<<<<<<<
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->tp->strides()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 104, __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/tensor.pxi":103
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         return tuple(self.tp.strides())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":106
 *         return tuple(self.tp.strides())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Tensor_15__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Tensor_15__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_14__getbuffer__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Tensor_14__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags) {
  PyObject *__pyx_v_pep3118_format = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  if (__pyx_v_buffer == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "pyarrow/tensor.pxi":107
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         buffer.buf = <char *> self.tp.data().get().data()             # <<<<<<<<<<<<<<
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 */
  __pyx_v_buffer->buf = ((char *)__pyx_v_self->tp->data().get()->data());

  /* "pyarrow/tensor.pxi":108
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format             # <<<<<<<<<<<<<<
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "
 */
  __pyx_t_1 = __pyx_v_self->type->pep3118_format;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_pep3118_format = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":109
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))
 */
  __pyx_t_2 = (__pyx_v_pep3118_format == ((PyObject*)Py_None));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/tensor.pxi":110
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "             # <<<<<<<<<<<<<<
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_type_2);
    __pyx_t_4 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_type_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_type_2);

    /* "pyarrow/tensor.pxi":111
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))             # <<<<<<<<<<<<<<
 *         buffer.format = pep3118_format
 *         buffer.itemsize = self.type.bit_width // 8
 */
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(((PyObject *)__pyx_v_self->type)), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_not_supported_for_buffer_protoc);
    __pyx_t_4 += 34;
    __Pyx_GIVEREF(__pyx_kp_u_not_supported_for_buffer_protoc);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_not_supported_for_buffer_protoc);

    /* "pyarrow/tensor.pxi":110
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "             # <<<<<<<<<<<<<<
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 */
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(13, 110, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":109
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))
 */
  }

  /* "pyarrow/tensor.pxi":112
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format             # <<<<<<<<<<<<<<
 *         buffer.itemsize = self.type.bit_width // 8
 *         buffer.internal = NULL
 */
  if (unlikely(__pyx_v_pep3118_format == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(13, 112, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_pep3118_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(13, 112, __pyx_L1_error)
  __pyx_v_buffer->format = __pyx_t_7;

  /* "pyarrow/tensor.pxi":113
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 *         buffer.itemsize = self.type.bit_width // 8             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 *         buffer.len = self.tp.size() * buffer.itemsize
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_bit_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_1, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_buffer->itemsize = __pyx_t_4;

  /* "pyarrow/tensor.pxi":114
 *         buffer.format = pep3118_format
 *         buffer.itemsize = self.type.bit_width // 8
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 *         buffer.len = self.tp.size() * buffer.itemsize
 *         buffer.ndim = self.tp.ndim()
 */
  __pyx_v_buffer->internal = NULL;

  /* "pyarrow/tensor.pxi":115
 *         buffer.itemsize = self.type.bit_width // 8
 *         buffer.internal = NULL
 *         buffer.len = self.tp.size() * buffer.itemsize             # <<<<<<<<<<<<<<
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 */
  __pyx_v_buffer->len = (__pyx_v_self->tp->size() * __pyx_v_buffer->itemsize);

  /* "pyarrow/tensor.pxi":116
 *         buffer.internal = NULL
 *         buffer.len = self.tp.size() * buffer.itemsize
 *         buffer.ndim = self.tp.ndim()             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         if self.tp.is_mutable():
 */
  __pyx_v_buffer->ndim = __pyx_v_self->tp->ndim();

  /* "pyarrow/tensor.pxi":117
 *         buffer.len = self.tp.size() * buffer.itemsize
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         if self.tp.is_mutable():
 *             buffer.readonly = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "pyarrow/tensor.pxi":118
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 *         if self.tp.is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
  __pyx_t_3 = (__pyx_v_self->tp->is_mutable() != 0);
  if (__pyx_t_3) {

    /* "pyarrow/tensor.pxi":119
 *         buffer.obj = self
 *         if self.tp.is_mutable():
 *             buffer.readonly = 0             # <<<<<<<<<<<<<<
 *         else:
 *             buffer.readonly = 1
 */
    __pyx_v_buffer->readonly = 0;

    /* "pyarrow/tensor.pxi":118
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 *         if self.tp.is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/tensor.pxi":121
 *             buffer.readonly = 0
 *         else:
 *             buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         # NOTE: This assumes Py_ssize_t == int64_t, and that the shape
 *         # and strides arrays lifetime is tied to the tensor's
 */
  /*else*/ {
    __pyx_v_buffer->readonly = 1;
  }
  __pyx_L4:;

  /* "pyarrow/tensor.pxi":124
 *         # NOTE: This assumes Py_ssize_t == int64_t, and that the shape
 *         # and strides arrays lifetime is tied to the tensor's
 *         buffer.shape = <Py_ssize_t *> &self.tp.shape()[0]             # <<<<<<<<<<<<<<
 *         buffer.strides = <Py_ssize_t *> &self.tp.strides()[0]
 *         buffer.suboffsets = NULL
 */
  __pyx_v_buffer->shape = ((Py_ssize_t *)(&(__pyx_v_self->tp->shape()[0])));

  /* "pyarrow/tensor.pxi":125
 *         # and strides arrays lifetime is tied to the tensor's
 *         buffer.shape = <Py_ssize_t *> &self.tp.shape()[0]
 *         buffer.strides = <Py_ssize_t *> &self.tp.strides()[0]             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 * 
 */
  __pyx_v_buffer->strides = ((Py_ssize_t *)(&(__pyx_v_self->tp->strides()[0])));

  /* "pyarrow/tensor.pxi":126
 *         buffer.shape = <Py_ssize_t *> &self.tp.shape()[0]
 *         buffer.strides = <Py_ssize_t *> &self.tp.strides()[0]
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_buffer->suboffsets = NULL;

  /* "pyarrow/tensor.pxi":106
 *         return tuple(self.tp.strides())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_buffer->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_pep3118_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":254
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4type___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_16__reduce_cython__[] = "Tensor.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_16__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__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.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_18__setstate_cython__[] = "Tensor.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_18__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":134
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseTensorCOO's constructor directly, "
 *                         "use one of the `pyarrow.SparseTensorCOO.from_*` "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO___init__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_15SparseTensorCOO___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/tensor.pxi":135
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseTensorCOO's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseTensorCOO.from_*` "
 *                         "functions instead.")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__167, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 135, __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(13, 135, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":134
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseTensorCOO's constructor directly, "
 *                         "use one of the `pyarrow.SparseTensorCOO.from_*` "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":139
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

static void __pyx_f_7pyarrow_3lib_15SparseTensorCOO_init(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, std::shared_ptr< arrow::SparseTensorCOO>  const &__pyx_v_sp_sparse_tensor) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/tensor.pxi":140
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor             # <<<<<<<<<<<<<<
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 */
  __pyx_v_self->sp_sparse_tensor = __pyx_v_sp_sparse_tensor;

  /* "pyarrow/tensor.pxi":141
 *     cdef void init(self, const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 */
  __pyx_v_self->stp = __pyx_v_sp_sparse_tensor.get();

  /* "pyarrow/tensor.pxi":142
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->stp->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(13, 142, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":139
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.SparseTensorCOO.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/tensor.pxi":144
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseTensorCOO>
 * type: {0.type}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_2__repr__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/tensor.pxi":145
 * 
 *     def __repr__(self):
 *         return """<pyarrow.SparseTensorCOO>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}""".format(self)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/tensor.pxi":147
 *         return """<pyarrow.SparseTensorCOO>
 * type: {0.type}
 * shape: {0.shape}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_SparseTensorCOO_type_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 147, __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/tensor.pxi":144
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseTensorCOO>
 * type: {0.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.lib.SparseTensorCOO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":150
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseTensorCOO
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_4from_dense_numpy[] = "SparseTensorCOO.from_dense_numpy(type cls, obj, dim_names=None)\n\n        Convert numpy.ndarray to arrow::SparseTensorCOO\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dense_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_dense_numpy") < 0)) __PYX_ERR(13, 150, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dense_numpy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 150, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4from_dense_numpy(((PyTypeObject*)__pyx_v_cls), __pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  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;
  __Pyx_RefNannySetupContext("from_dense_numpy", 0);

  /* "pyarrow/tensor.pxi":154
 *         Convert numpy.ndarray to arrow::SparseTensorCOO
 *         """
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor), __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dim_names, __pyx_v_dim_names) < 0) __PYX_ERR(13, 154, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __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_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 154, __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/tensor.pxi":150
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseTensorCOO
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCOO from numpy.ndarrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_6from_numpy[] = "SparseTensorCOO.from_numpy(data, coords, shape, dim_names=None)\n\n        Create arrow::SparseTensorCOO from numpy.ndarrays\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseTensorCOO_7from_numpy = {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_6from_numpy};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_coords = 0;
  PyObject *__pyx_v_shape = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_coords,&__pyx_n_s_shape,&__pyx_n_s_dim_names,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 3, 4, 1); __PYX_ERR(13, 157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 3, 4, 2); __PYX_ERR(13, 157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_numpy") < 0)) __PYX_ERR(13, 157, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_coords = values[1];
    __pyx_v_shape = values[2];
    __pyx_v_dim_names = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 157, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_6from_numpy(__pyx_v_data, __pyx_v_coords, __pyx_v_shape, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_coords, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names) {
  std::shared_ptr< arrow::SparseTensorCOO>  __pyx_v_csparse_tensor;
  std::vector<int64_t>  __pyx_v_c_shape;
  std::vector<std::string>  __pyx_v_c_dim_names;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("from_numpy", 0);
  __Pyx_INCREF(__pyx_v_coords);

  /* "pyarrow/tensor.pxi":165
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  if (likely(PyList_CheckExact(__pyx_v_shape)) || PyTuple_CheckExact(__pyx_v_shape)) {
    __pyx_t_1 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 165, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 165, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 165, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 165, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/tensor.pxi":166
 * 
 *         for x in shape:
 *             c_shape.push_back(x)             # <<<<<<<<<<<<<<
 *         if dim_names is not None:
 *             for x in dim_names:
 */
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_x); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 166, __pyx_L1_error)
    try {
      __pyx_v_c_shape.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 166, __pyx_L1_error)
    }

    /* "pyarrow/tensor.pxi":165
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":167
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_6 = (__pyx_v_dim_names != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "pyarrow/tensor.pxi":168
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_1 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
      __pyx_t_3 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 168, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_3)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 168, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 168, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 168, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 168, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_3(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 168, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/tensor.pxi":169
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         # Enforce precondition for SparseTensorCOO indices
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 169, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 169, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":168
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":167
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":172
 * 
 *         # Enforce precondition for SparseTensorCOO indices
 *         coords = np.require(coords, dtype='i8', requirements='F')             # <<<<<<<<<<<<<<
 *         if coords.ndim != 2:
 *             raise ValueError("Expected 2-dimensional array for "
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_require); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_coords);
  __Pyx_GIVEREF(__pyx_v_coords);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_coords);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_requirements, __pyx_n_u_F) < 0) __PYX_ERR(13, 172, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_coords, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":173
 *         # Enforce precondition for SparseTensorCOO indices
 *         coords = np.require(coords, dtype='i8', requirements='F')
 *         if coords.ndim != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 2-dimensional array for "
 *                              "SparseTensorCOO indices")
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyInt_NeObjC(__pyx_t_9, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(13, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "pyarrow/tensor.pxi":174
 *         coords = np.require(coords, dtype='i8', requirements='F')
 *         if coords.ndim != 2:
 *             raise ValueError("Expected 2-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseTensorCOO indices")
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__168, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(13, 174, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":173
 *         # Enforce precondition for SparseTensorCOO indices
 *         coords = np.require(coords, dtype='i8', requirements='F')
 *         if coords.ndim != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 2-dimensional array for "
 *                              "SparseTensorCOO indices")
 */
  }

  /* "pyarrow/tensor.pxi":177
 *                              "SparseTensorCOO indices")
 * 
 *         check_status(NdarraysToSparseTensorCOO(c_default_memory_pool(),             # <<<<<<<<<<<<<<
 *                      data, coords, c_shape, c_dim_names, &csparse_tensor))
 *         return pyarrow_wrap_sparse_tensor_coo(csparse_tensor)
 */
  __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarraysToSparseTensorCOO( arrow::default_memory_pool(), __pyx_v_data, __pyx_v_coords, __pyx_v_c_shape, __pyx_v_c_dim_names, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(13, 177, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":179
 *         check_status(NdarraysToSparseTensorCOO(c_default_memory_pool(),
 *                      data, coords, c_shape, c_dim_names, &csparse_tensor))
 *         return pyarrow_wrap_sparse_tensor_coo(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_coo(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCOO from numpy.ndarrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":182
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCOO
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_9from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_8from_tensor[] = "SparseTensorCOO.from_tensor(obj)\n\n        Convert arrow::Tensor to arrow::SparseTensorCOO\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseTensorCOO_9from_tensor = {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_9from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_8from_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_9from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_tensor (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_tensor") < 0)) __PYX_ERR(13, 182, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_tensor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 182, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_8from_tensor(__pyx_v_obj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_8from_tensor(PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::SparseTensorCOO>  __pyx_v_csparse_tensor;
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("from_tensor", 0);

  /* "pyarrow/tensor.pxi":187
 *         """
 *         cdef shared_ptr[CSparseTensorCOO] csparse_tensor
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_ctensor = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(__pyx_v_obj);

  /* "pyarrow/tensor.pxi":189
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseTensorCOO(ctensor, &csparse_tensor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/tensor.pxi":190
 * 
 *         with nogil:
 *             check_status(TensorToSparseTensorCOO(ctensor, &csparse_tensor))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_sparse_tensor_coo(csparse_tensor)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::TensorToSparseTensorCOO(__pyx_v_ctensor, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 190, __pyx_L4_error)
      }

      /* "pyarrow/tensor.pxi":189
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseTensorCOO(ctensor, &csparse_tensor))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/tensor.pxi":192
 *             check_status(TensorToSparseTensorCOO(ctensor, &csparse_tensor))
 * 
 *         return pyarrow_wrap_sparse_tensor_coo(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_coo(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":182
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCOO
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":194
 *         return pyarrow_wrap_sparse_tensor_coo(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseTensorCOO to numpy.ndarrays with zero copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_11to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_10to_numpy[] = "SparseTensorCOO.to_numpy(self)\n\n        Convert arrow::SparseTensorCOO to numpy.ndarrays with zero copy\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_11to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_10to_numpy(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_10to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_v_out_data;
  PyObject *__pyx_v_out_coords;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/tensor.pxi":201
 *         cdef PyObject* out_coords
 * 
 *         check_status(SparseTensorCOOToNdarray(self.sp_sparse_tensor, self,             # <<<<<<<<<<<<<<
 *                                               &out_data, &out_coords))
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SparseTensorCOOToNdarray(__pyx_v_self->sp_sparse_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out_data), (&__pyx_v_out_coords))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 201, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":203
 *         check_status(SparseTensorCOOToNdarray(self.sp_sparse_tensor, self,
 *                                               &out_data, &out_coords))
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, SparseTensorCOO other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":194
 *         return pyarrow_wrap_sparse_tensor_coo(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseTensorCOO to numpy.ndarrays with zero copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":205
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)
 * 
 *     def equals(self, SparseTensorCOO other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_12equals[] = "SparseTensorCOO.equals(self, SparseTensorCOO other)\n\n        Return true if sparse tensors contains exactly equal data\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_SparseTensorCOO, 1, "other", 0))) __PYX_ERR(13, 205, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_12equals(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_12equals(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/tensor.pxi":209
 *         Return true if sparse tensors contains exactly equal data
 *         """
 *         return self.stp.Equals(deref(other.stp))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->Equals((*__pyx_v_other->stp))); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":205
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)
 * 
 *     def equals(self, SparseTensorCOO other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":211
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseTensorCOO):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_14__eq__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_14__eq__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/tensor.pxi":212
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseTensorCOO):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_SparseTensorCOO); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":213
 *     def __eq__(self, other):
 *         if isinstance(other, SparseTensorCOO):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/tensor.pxi":212
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseTensorCOO):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/tensor.pxi":215
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/tensor.pxi":211
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseTensorCOO):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":218
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":219
 *     @property
 *     def is_mutable(self):
 *         return self.stp.is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":218
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":222
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4ndim___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":223
 *     @property
 *     def ndim(self):
 *         return self.stp.ndim()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->stp->ndim()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":222
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":226
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":228
 *     def shape(self):
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->stp->shape()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 228, __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/tensor.pxi":226
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":231
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4size___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":232
 *     @property
 *     def size(self):
 *         return self.stp.size()             # <<<<<<<<<<<<<<
 * 
 *     def dim_name(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":231
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":234
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_17dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_16dim_name[] = "SparseTensorCOO.dim_name(self, i)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_17dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dim_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_16dim_name(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_16dim_name(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("dim_name", 0);

  /* "pyarrow/tensor.pxi":235
 * 
 *     def dim_name(self, i):
 *         return frombytes(self.stp.dim_name(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 235, __pyx_L1_error)
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->stp->dim_name(__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 235, __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/tensor.pxi":234
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

  /* 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_AddTraceback("pyarrow.lib.SparseTensorCOO.dim_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":238
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.stp.dim_names())]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_9dim_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_9dim_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_9dim_names___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_9genexpr15__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":239
 *     @property
 *     def dim_names(self):
 *         return [frombytes(x) for x in tuple(self.stp.dim_names())]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 239, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_self->stp->dim_names()); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 239, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 239, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 239, __pyx_L5_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 239, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 239, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_9genexpr15__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr15__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 239, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(13, 239, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x); __pyx_9genexpr15__pyx_v_x = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x); __pyx_9genexpr15__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":238
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.stp.dim_names())]
 * 
 */

  /* 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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.dim_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":242
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_15non_zero_length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_15non_zero_length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_15non_zero_length___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":243
 *     @property
 *     def non_zero_length(self):
 *         return self.stp.non_zero_length()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->non_zero_length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":242
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.non_zero_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":276
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4type___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_18__reduce_cython__[] = "SparseTensorCOO.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_18__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__169, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.__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.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_20__setstate_cython__[] = "SparseTensorCOO.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCOO_20__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCOO_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__170, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCOO.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":251
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseTensorCSR's constructor directly, "
 *                         "use one of the `pyarrow.SparseTensorCSR.from_*` "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR___init__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_15SparseTensorCSR___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/tensor.pxi":252
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseTensorCSR's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseTensorCSR.from_*` "
 *                         "functions instead.")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__171, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 252, __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(13, 252, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":251
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseTensorCSR's constructor directly, "
 *                         "use one of the `pyarrow.SparseTensorCSR.from_*` "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":256
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

static void __pyx_f_7pyarrow_3lib_15SparseTensorCSR_init(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, std::shared_ptr< arrow::SparseTensorCSR>  const &__pyx_v_sp_sparse_tensor) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/tensor.pxi":257
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor             # <<<<<<<<<<<<<<
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 */
  __pyx_v_self->sp_sparse_tensor = __pyx_v_sp_sparse_tensor;

  /* "pyarrow/tensor.pxi":258
 *     cdef void init(self, const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 */
  __pyx_v_self->stp = __pyx_v_sp_sparse_tensor.get();

  /* "pyarrow/tensor.pxi":259
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->stp->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(13, 259, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":256
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.SparseTensorCSR.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/tensor.pxi":261
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseTensorCSR>
 * type: {0.type}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_2__repr__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/tensor.pxi":262
 * 
 *     def __repr__(self):
 *         return """<pyarrow.SparseTensorCSR>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}""".format(self)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/tensor.pxi":264
 *         return """<pyarrow.SparseTensorCSR>
 * type: {0.type}
 * shape: {0.shape}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_SparseTensorCSR_type_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 264, __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/tensor.pxi":261
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseTensorCSR>
 * type: {0.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.lib.SparseTensorCSR.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":267
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseTensorCSR
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_4from_dense_numpy[] = "SparseTensorCSR.from_dense_numpy(type cls, obj, dim_names=None)\n\n        Convert numpy.ndarray to arrow::SparseTensorCSR\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dense_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_dense_numpy") < 0)) __PYX_ERR(13, 267, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dense_numpy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 267, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4from_dense_numpy(((PyTypeObject*)__pyx_v_cls), __pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  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;
  __Pyx_RefNannySetupContext("from_dense_numpy", 0);

  /* "pyarrow/tensor.pxi":271
 *         Convert numpy.ndarray to arrow::SparseTensorCSR
 *         """
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor), __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dim_names, __pyx_v_dim_names) < 0) __PYX_ERR(13, 271, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __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_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 271, __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/tensor.pxi":267
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseTensorCSR
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":274
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCSR from numpy.ndarrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_6from_numpy[] = "SparseTensorCSR.from_numpy(data, indptr, indices, shape, dim_names=None)\n\n        Create arrow::SparseTensorCSR from numpy.ndarrays\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseTensorCSR_7from_numpy = {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_6from_numpy};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_indptr = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_shape = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_indptr,&__pyx_n_s_indices,&__pyx_n_s_shape,&__pyx_n_s_dim_names,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indptr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, 1); __PYX_ERR(13, 274, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, 2); __PYX_ERR(13, 274, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, 3); __PYX_ERR(13, 274, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_numpy") < 0)) __PYX_ERR(13, 274, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_indptr = values[1];
    __pyx_v_indices = values[2];
    __pyx_v_shape = values[3];
    __pyx_v_dim_names = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 274, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_6from_numpy(__pyx_v_data, __pyx_v_indptr, __pyx_v_indices, __pyx_v_shape, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_indptr, PyObject *__pyx_v_indices, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names) {
  std::shared_ptr< arrow::SparseTensorCSR>  __pyx_v_csparse_tensor;
  std::vector<int64_t>  __pyx_v_c_shape;
  std::vector<std::string>  __pyx_v_c_dim_names;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("from_numpy", 0);
  __Pyx_INCREF(__pyx_v_indptr);
  __Pyx_INCREF(__pyx_v_indices);

  /* "pyarrow/tensor.pxi":282
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  if (likely(PyList_CheckExact(__pyx_v_shape)) || PyTuple_CheckExact(__pyx_v_shape)) {
    __pyx_t_1 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 282, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 282, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 282, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 282, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/tensor.pxi":283
 * 
 *         for x in shape:
 *             c_shape.push_back(x)             # <<<<<<<<<<<<<<
 *         if dim_names is not None:
 *             for x in dim_names:
 */
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_x); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 283, __pyx_L1_error)
    try {
      __pyx_v_c_shape.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 283, __pyx_L1_error)
    }

    /* "pyarrow/tensor.pxi":282
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":284
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_6 = (__pyx_v_dim_names != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "pyarrow/tensor.pxi":285
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_1 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
      __pyx_t_3 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 285, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_3)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 285, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 285, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 285, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 285, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_3(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 285, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/tensor.pxi":286
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         # Enforce precondition for SparseTensorCSR indices
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 286, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 286, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":285
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":284
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":289
 * 
 *         # Enforce precondition for SparseTensorCSR indices
 *         indptr = np.require(indptr, dtype='i8')             # <<<<<<<<<<<<<<
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_require); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_indptr);
  __Pyx_GIVEREF(__pyx_v_indptr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indptr);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 289, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_indptr, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":290
 *         # Enforce precondition for SparseTensorCSR indices
 *         indptr = np.require(indptr, dtype='i8')
 *         indices = np.require(indices, dtype='i8')             # <<<<<<<<<<<<<<
 *         if indptr.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_require); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_indices);
  __Pyx_GIVEREF(__pyx_v_indices);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_indices);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 290, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/tensor.pxi":291
 *         indptr = np.require(indptr, dtype='i8')
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseTensorCSR indptr")
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_indptr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(13, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "pyarrow/tensor.pxi":292
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseTensorCSR indptr")
 *         if indices.ndim != 1:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__172, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 292, __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(13, 292, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":291
 *         indptr = np.require(indptr, dtype='i8')
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseTensorCSR indptr")
 */
  }

  /* "pyarrow/tensor.pxi":294
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseTensorCSR indptr")
 *         if indices.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseTensorCSR indices")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indices, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(13, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "pyarrow/tensor.pxi":295
 *                              "SparseTensorCSR indptr")
 *         if indices.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseTensorCSR indices")
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__173, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 295, __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(13, 295, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":294
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseTensorCSR indptr")
 *         if indices.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseTensorCSR indices")
 */
  }

  /* "pyarrow/tensor.pxi":298
 *                              "SparseTensorCSR indices")
 * 
 *         check_status(NdarraysToSparseTensorCSR(c_default_memory_pool(),             # <<<<<<<<<<<<<<
 *                      data, indptr, indices, c_shape, c_dim_names,
 *                      &csparse_tensor))
 */
  __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarraysToSparseTensorCSR( arrow::default_memory_pool(), __pyx_v_data, __pyx_v_indptr, __pyx_v_indices, __pyx_v_c_shape, __pyx_v_c_dim_names, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(13, 298, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":301
 *                      data, indptr, indices, c_shape, c_dim_names,
 *                      &csparse_tensor))
 *         return pyarrow_wrap_sparse_tensor_csr(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_csr(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":274
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCSR from numpy.ndarrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_indptr);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":304
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCSR
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_9from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_8from_tensor[] = "SparseTensorCSR.from_tensor(obj)\n\n        Convert arrow::Tensor to arrow::SparseTensorCSR\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseTensorCSR_9from_tensor = {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_9from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_8from_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_9from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_tensor (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_tensor") < 0)) __PYX_ERR(13, 304, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_tensor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 304, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_8from_tensor(__pyx_v_obj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_8from_tensor(PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::SparseTensorCSR>  __pyx_v_csparse_tensor;
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("from_tensor", 0);

  /* "pyarrow/tensor.pxi":309
 *         """
 *         cdef shared_ptr[CSparseTensorCSR] csparse_tensor
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_ctensor = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(__pyx_v_obj);

  /* "pyarrow/tensor.pxi":311
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseTensorCSR(ctensor, &csparse_tensor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/tensor.pxi":312
 * 
 *         with nogil:
 *             check_status(TensorToSparseTensorCSR(ctensor, &csparse_tensor))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_sparse_tensor_csr(csparse_tensor)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::TensorToSparseTensorCSR(__pyx_v_ctensor, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 312, __pyx_L4_error)
      }

      /* "pyarrow/tensor.pxi":311
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseTensorCSR(ctensor, &csparse_tensor))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/tensor.pxi":314
 *             check_status(TensorToSparseTensorCSR(ctensor, &csparse_tensor))
 * 
 *         return pyarrow_wrap_sparse_tensor_csr(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_csr(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":304
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCSR
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":316
 *         return pyarrow_wrap_sparse_tensor_csr(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseTensorCSR to numpy.ndarrays with zero copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_11to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_10to_numpy[] = "SparseTensorCSR.to_numpy(self)\n\n        Convert arrow::SparseTensorCSR to numpy.ndarrays with zero copy\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_11to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_10to_numpy(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_10to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_v_out_data;
  PyObject *__pyx_v_out_indptr;
  PyObject *__pyx_v_out_indices;
  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;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/tensor.pxi":324
 *         cdef PyObject* out_indices
 * 
 *         check_status(SparseTensorCSRToNdarray(self.sp_sparse_tensor, self,             # <<<<<<<<<<<<<<
 *                      &out_data, &out_indptr, &out_indices))
 *         return (PyObject_to_object(out_data), PyObject_to_object(out_indptr),
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SparseTensorCSRToNdarray(__pyx_v_self->sp_sparse_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out_data), (&__pyx_v_out_indptr), (&__pyx_v_out_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 324, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":326
 *         check_status(SparseTensorCSRToNdarray(self.sp_sparse_tensor, self,
 *                      &out_data, &out_indptr, &out_indices))
 *         return (PyObject_to_object(out_data), PyObject_to_object(out_indptr),             # <<<<<<<<<<<<<<
 *                 PyObject_to_object(out_indices))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/tensor.pxi":327
 *                      &out_data, &out_indptr, &out_indices))
 *         return (PyObject_to_object(out_data), PyObject_to_object(out_indptr),
 *                 PyObject_to_object(out_indices))             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, SparseTensorCSR other):
 */
  __pyx_t_4 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/tensor.pxi":326
 *         check_status(SparseTensorCSRToNdarray(self.sp_sparse_tensor, self,
 *                      &out_data, &out_indptr, &out_indices))
 *         return (PyObject_to_object(out_data), PyObject_to_object(out_indptr),             # <<<<<<<<<<<<<<
 *                 PyObject_to_object(out_indices))
 * 
 */
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":316
 *         return pyarrow_wrap_sparse_tensor_csr(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseTensorCSR to numpy.ndarrays with zero copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":329
 *                 PyObject_to_object(out_indices))
 * 
 *     def equals(self, SparseTensorCSR other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_12equals[] = "SparseTensorCSR.equals(self, SparseTensorCSR other)\n\n        Return true if sparse tensors contains exactly equal data\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_SparseTensorCSR, 1, "other", 0))) __PYX_ERR(13, 329, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_12equals(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_12equals(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/tensor.pxi":333
 *         Return true if sparse tensors contains exactly equal data
 *         """
 *         return self.stp.Equals(deref(other.stp))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->Equals((*__pyx_v_other->stp))); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":329
 *                 PyObject_to_object(out_indices))
 * 
 *     def equals(self, SparseTensorCSR other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":335
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseTensorCSR):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_14__eq__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_14__eq__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/tensor.pxi":336
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseTensorCSR):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_SparseTensorCSR); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":337
 *     def __eq__(self, other):
 *         if isinstance(other, SparseTensorCSR):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/tensor.pxi":336
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseTensorCSR):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/tensor.pxi":339
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/tensor.pxi":335
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseTensorCSR):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":342
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":343
 *     @property
 *     def is_mutable(self):
 *         return self.stp.is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":342
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":346
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4ndim___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":347
 *     @property
 *     def ndim(self):
 *         return self.stp.ndim()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->stp->ndim()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":346
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":350
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":352
 *     def shape(self):
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->stp->shape()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 352, __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/tensor.pxi":350
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":355
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4size___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":356
 *     @property
 *     def size(self):
 *         return self.stp.size()             # <<<<<<<<<<<<<<
 * 
 *     def dim_name(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":355
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":358
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_17dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_16dim_name[] = "SparseTensorCSR.dim_name(self, i)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_17dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dim_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_16dim_name(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_16dim_name(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("dim_name", 0);

  /* "pyarrow/tensor.pxi":359
 * 
 *     def dim_name(self, i):
 *         return frombytes(self.stp.dim_name(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 359, __pyx_L1_error)
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->stp->dim_name(__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 359, __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/tensor.pxi":358
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

  /* 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_AddTraceback("pyarrow.lib.SparseTensorCSR.dim_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":362
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.stp.dim_names())]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_9dim_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_9dim_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_9dim_names___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_9genexpr16__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":363
 *     @property
 *     def dim_names(self):
 *         return [frombytes(x) for x in tuple(self.stp.dim_names())]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 363, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_self->stp->dim_names()); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 363, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 363, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 363, __pyx_L5_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 363, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 363, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_9genexpr16__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr16__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 363, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(13, 363, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_x); __pyx_9genexpr16__pyx_v_x = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_x); __pyx_9genexpr16__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":362
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.stp.dim_names())]
 * 
 */

  /* 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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.dim_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":366
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_15non_zero_length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_15non_zero_length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_15non_zero_length___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":367
 *     @property
 *     def non_zero_length(self):
 *         return self.stp.non_zero_length()             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->non_zero_length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":366
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.non_zero_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":265
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4type___get__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_18__reduce_cython__[] = "SparseTensorCSR.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_18__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__174, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.__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.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_20__setstate_cython__[] = "SparseTensorCSR.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseTensorCSR_20__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseTensorCSR_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__175, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseTensorCSR.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":62
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.own_file = False
 *         self.is_readable = False
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":63
 * 
 *     def __cinit__(self):
 *         self.own_file = False             # <<<<<<<<<<<<<<
 *         self.is_readable = False
 *         self.is_writable = False
 */
  __pyx_v_self->own_file = 0;

  /* "pyarrow/io.pxi":64
 *     def __cinit__(self):
 *         self.own_file = False
 *         self.is_readable = False             # <<<<<<<<<<<<<<
 *         self.is_writable = False
 *         self.is_seekable = False
 */
  __pyx_v_self->is_readable = 0;

  /* "pyarrow/io.pxi":65
 *         self.own_file = False
 *         self.is_readable = False
 *         self.is_writable = False             # <<<<<<<<<<<<<<
 *         self.is_seekable = False
 * 
 */
  __pyx_v_self->is_writable = 0;

  /* "pyarrow/io.pxi":66
 *         self.is_readable = False
 *         self.is_writable = False
 *         self.is_seekable = False             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->is_seekable = 0;

  /* "pyarrow/io.pxi":62
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.own_file = False
 *         self.is_readable = False
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":68
 *         self.is_seekable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file:
 *             self.close()
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io.pxi":69
 * 
 *     def __dealloc__(self):
 *         if self.own_file:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_1 = (__pyx_v_self->own_file != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":70
 *     def __dealloc__(self):
 *         if self.own_file:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":69
 * 
 *     def __dealloc__(self):
 *         if self.own_file:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "pyarrow/io.pxi":68
 *         self.is_seekable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file:
 *             self.close()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyarrow.lib.NativeFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":72
 *             self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_4__enter__[] = "NativeFile.__enter__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_4__enter__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4__enter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/io.pxi":73
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_value, tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":72
 *             self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":75
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_6__exit__[] = "NativeFile.__exit__(self, exc_type, exc_value, tb)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_value,&__pyx_n_s_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(6, 75, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(6, 75, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(6, 75, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_value = values[1];
    __pyx_v_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 75, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_6__exit__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_tb);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6__exit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pyarrow/io.pxi":76
 * 
 *     def __exit__(self, exc_type, exc_value, tb):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":75
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, tb):             # <<<<<<<<<<<<<<
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":79
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The file mode. Currently instances of NativeFile may support:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":88
 *         """
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'rb+'
 *         elif self.is_readable:
 */
  __pyx_t_2 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->is_writable != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":89
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'             # <<<<<<<<<<<<<<
 *         elif self.is_readable:
 *             return 'rb'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u_rb);
    __pyx_r = __pyx_kp_u_rb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":88
 *         """
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'rb+'
 *         elif self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":90
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'
 *         elif self.is_readable:             # <<<<<<<<<<<<<<
 *             return 'rb'
 *         elif self.is_writable:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":91
 *             return 'rb+'
 *         elif self.is_readable:
 *             return 'rb'             # <<<<<<<<<<<<<<
 *         elif self.is_writable:
 *             return 'wb'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_rb_2);
    __pyx_r = __pyx_n_u_rb_2;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":90
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'
 *         elif self.is_readable:             # <<<<<<<<<<<<<<
 *             return 'rb'
 *         elif self.is_writable:
 */
  }

  /* "pyarrow/io.pxi":92
 *         elif self.is_readable:
 *             return 'rb'
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'wb'
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->is_writable != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":93
 *             return 'rb'
 *         elif self.is_writable:
 *             return 'wb'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('File object is malformed, has no mode')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_wb);
    __pyx_r = __pyx_n_u_wb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":92
 *         elif self.is_readable:
 *             return 'rb'
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'wb'
 *         else:
 */
  }

  /* "pyarrow/io.pxi":95
 *             return 'wb'
 *         else:
 *             raise ValueError('File object is malformed, has no mode')             # <<<<<<<<<<<<<<
 * 
 *     def readable(self):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 95, __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(6, 95, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":79
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The file mode. Currently instances of NativeFile may support:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":97
 *             raise ValueError('File object is malformed, has no mode')
 * 
 *     def readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_readable
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_9readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_8readable[] = "NativeFile.readable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_9readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8readable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readable", 0);

  /* "pyarrow/io.pxi":98
 * 
 *     def readable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.is_readable
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":99
 *     def readable(self):
 *         self._assert_open()
 *         return self.is_readable             # <<<<<<<<<<<<<<
 * 
 *     def writable(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_readable); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":97
 *             raise ValueError('File object is malformed, has no mode')
 * 
 *     def readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_readable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":101
 *         return self.is_readable
 * 
 *     def writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_writable
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_11writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_10writable[] = "NativeFile.writable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_11writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_10writable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_10writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("writable", 0);

  /* "pyarrow/io.pxi":102
 * 
 *     def writable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.is_writable
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":103
 *     def writable(self):
 *         self._assert_open()
 *         return self.is_writable             # <<<<<<<<<<<<<<
 * 
 *     def seekable(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_writable); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":101
 *         return self.is_readable
 * 
 *     def writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_writable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.writable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":105
 *         return self.is_writable
 * 
 *     def seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_seekable
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_12seekable[] = "NativeFile.seekable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seekable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("seekable", 0);

  /* "pyarrow/io.pxi":106
 * 
 *     def seekable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.is_seekable
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":107
 *     def seekable(self):
 *         self._assert_open()
 *         return self.is_seekable             # <<<<<<<<<<<<<<
 * 
 *     def isatty(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_seekable); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":105
 *         return self.is_writable
 * 
 *     def seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_seekable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":109
 *         return self.is_seekable
 * 
 *     def isatty(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return False
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_14isatty[] = "NativeFile.isatty(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isatty (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("isatty", 0);

  /* "pyarrow/io.pxi":110
 * 
 *     def isatty(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":111
 *     def isatty(self):
 *         self._assert_open()
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":109
 *         return self.is_seekable
 * 
 *     def isatty(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.isatty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":113
 *         return False
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_17fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_16fileno[] = "NativeFile.fileno(self)\n\n        NOT IMPLEMENTED\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_17fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_16fileno(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_16fileno(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fileno", 0);

  /* "pyarrow/io.pxi":117
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 117, __pyx_L1_error)

  /* "pyarrow/io.pxi":113
 *         return False
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":120
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":121
 *     @property
 *     def closed(self):
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":122
 *     def closed(self):
 *         if self.is_readable:
 *             return self.input_stream.get().closed()             # <<<<<<<<<<<<<<
 *         elif self.is_writable:
 *             return self.output_stream.get().closed()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->input_stream.get()->closed()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":121
 *     @property
 *     def closed(self):
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 */
  }

  /* "pyarrow/io.pxi":123
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return self.output_stream.get().closed()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->is_writable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":124
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 *             return self.output_stream.get().closed()             # <<<<<<<<<<<<<<
 *         else:
 *             return True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->output_stream.get()->closed()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":123
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return self.output_stream.get().closed()
 *         else:
 */
  }

  /* "pyarrow/io.pxi":126
 *             return self.output_stream.get().closed()
 *         else:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":120
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":128
 *             return True
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if not self.closed:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_19close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_18close[] = "NativeFile.close(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_19close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_18close(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_18close(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/io.pxi":129
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 129, __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(6, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":130
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":131
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 */
          __pyx_t_3 = (__pyx_v_self->is_readable != 0);
          if (__pyx_t_3) {

            /* "pyarrow/io.pxi":132
 *             with nogil:
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())             # <<<<<<<<<<<<<<
 *                 else:
 *                     check_status(self.output_stream.get().Close())
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->input_stream.get()->Close()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 132, __pyx_L5_error)

            /* "pyarrow/io.pxi":131
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 */
            goto __pyx_L7;
          }

          /* "pyarrow/io.pxi":134
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 *                     check_status(self.output_stream.get().Close())             # <<<<<<<<<<<<<<
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):
 */
          /*else*/ {
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->output_stream.get()->Close()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 134, __pyx_L5_error)
          }
          __pyx_L7:;
        }

        /* "pyarrow/io.pxi":130
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":129
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":128
 *             return True
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if not self.closed:
 *             with nogil:
 */

  /* 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.lib.NativeFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":136
 *                     check_status(self.output_stream.get().Close())
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_random_access_file", 0);

  /* "pyarrow/io.pxi":137
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):
 *         self.input_stream = <shared_ptr[InputStream]> handle             # <<<<<<<<<<<<<<
 *         self.random_access = handle
 *         self.is_seekable = True
 */
  __pyx_v_self->input_stream = ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_handle);

  /* "pyarrow/io.pxi":138
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle             # <<<<<<<<<<<<<<
 *         self.is_seekable = True
 * 
 */
  __pyx_v_self->random_access = __pyx_v_handle;

  /* "pyarrow/io.pxi":139
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle
 *         self.is_seekable = True             # <<<<<<<<<<<<<<
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):
 */
  __pyx_v_self->is_seekable = 1;

  /* "pyarrow/io.pxi":136
 *                     check_status(self.output_stream.get().Close())
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":141
 *         self.is_seekable = True
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = handle
 *         self.random_access.reset()
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_stream", 0);

  /* "pyarrow/io.pxi":142
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):
 *         self.input_stream = handle             # <<<<<<<<<<<<<<
 *         self.random_access.reset()
 *         self.is_seekable = False
 */
  __pyx_v_self->input_stream = __pyx_v_handle;

  /* "pyarrow/io.pxi":143
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):
 *         self.input_stream = handle
 *         self.random_access.reset()             # <<<<<<<<<<<<<<
 *         self.is_seekable = False
 * 
 */
  __pyx_v_self->random_access.reset();

  /* "pyarrow/io.pxi":144
 *         self.input_stream = handle
 *         self.random_access.reset()
 *         self.is_seekable = False             # <<<<<<<<<<<<<<
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):
 */
  __pyx_v_self->is_seekable = 0;

  /* "pyarrow/io.pxi":141
 *         self.is_seekable = True
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = handle
 *         self.random_access.reset()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":146
 *         self.is_seekable = False
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):             # <<<<<<<<<<<<<<
 *         self.output_stream = handle
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_stream", 0);

  /* "pyarrow/io.pxi":147
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):
 *         self.output_stream = handle             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:
 */
  __pyx_v_self->output_stream = __pyx_v_handle;

  /* "pyarrow/io.pxi":146
 *         self.is_seekable = False
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):             # <<<<<<<<<<<<<<
 *         self.output_stream = handle
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":149
 *         self.output_stream = handle
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         self._assert_seekable()
 */

static std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_random_access_file", 0);

  /* "pyarrow/io.pxi":150
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         self._assert_seekable()
 *         return self.random_access
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":151
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:
 *         self._assert_readable()
 *         self._assert_seekable()             # <<<<<<<<<<<<<<
 *         return self.random_access
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_seekable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":152
 *         self._assert_readable()
 *         self._assert_seekable()
 *         return self.random_access             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:
 */
  __pyx_r = __pyx_v_self->random_access;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":149
 *         self.output_stream = handle
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         self._assert_seekable()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_random_access_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":154
 *         return self.random_access
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self.input_stream
 */

static std::shared_ptr<arrow::io::InputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr<arrow::io::InputStream>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_input_stream", 0);

  /* "pyarrow/io.pxi":155
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         return self.input_stream
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":156
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:
 *         self._assert_readable()
 *         return self.input_stream             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:
 */
  __pyx_r = __pyx_v_self->input_stream;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":154
 *         return self.random_access
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self.input_stream
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":158
 *         return self.input_stream
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         return self.output_stream
 */

static std::shared_ptr<arrow::io::OutputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr<arrow::io::OutputStream>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_output_stream", 0);

  /* "pyarrow/io.pxi":159
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 *         return self.output_stream
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":160
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:
 *         self._assert_writable()
 *         return self.output_stream             # <<<<<<<<<<<<<<
 * 
 *     def _assert_open(self):
 */
  __pyx_r = __pyx_v_self->output_stream;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":158
 *         return self.input_stream
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         return self.output_stream
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":162
 *         return self.output_stream
 * 
 *     def _assert_open(self):             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_21_assert_open(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_20_assert_open[] = "NativeFile._assert_open(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_21_assert_open(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_open (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_20_assert_open(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_20_assert_open(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_assert_open", 0);

  /* "pyarrow/io.pxi":163
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 163, __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(6, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":164
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__177, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 164, __pyx_L1_error)

    /* "pyarrow/io.pxi":163
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  }

  /* "pyarrow/io.pxi":162
 *         return self.output_stream
 * 
 *     def _assert_open(self):             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")
 */

  /* 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.lib.NativeFile._assert_open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":166
 *             raise ValueError("I/O operation on closed file")
 * 
 *     def _assert_readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_readable:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_22_assert_readable[] = "NativeFile._assert_readable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_readable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_22_assert_readable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_22_assert_readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__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;
  __Pyx_RefNannySetupContext("_assert_readable", 0);

  /* "pyarrow/io.pxi":167
 * 
 *     def _assert_readable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":168
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_readable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":170
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 170, __pyx_L1_error)

    /* "pyarrow/io.pxi":168
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")
 */
  }

  /* "pyarrow/io.pxi":166
 *             raise ValueError("I/O operation on closed file")
 * 
 *     def _assert_readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_readable:
 */

  /* 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.lib.NativeFile._assert_readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":172
 *             raise IOError("only valid on readonly files")
 * 
 *     def _assert_writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_writable:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_25_assert_writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_24_assert_writable[] = "NativeFile._assert_writable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_25_assert_writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_writable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_24_assert_writable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_24_assert_writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__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;
  __Pyx_RefNannySetupContext("_assert_writable", 0);

  /* "pyarrow/io.pxi":173
 * 
 *     def _assert_writable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":174
 *     def _assert_writable(self):
 *         self._assert_open()
 *         if not self.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on writable files")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_writable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":175
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_seekable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 175, __pyx_L1_error)

    /* "pyarrow/io.pxi":174
 *     def _assert_writable(self):
 *         self._assert_open()
 *         if not self.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on writable files")
 * 
 */
  }

  /* "pyarrow/io.pxi":172
 *             raise IOError("only valid on readonly files")
 * 
 *     def _assert_writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_writable:
 */

  /* 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.lib.NativeFile._assert_writable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":177
 *             raise IOError("only valid on writable files")
 * 
 *     def _assert_seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_seekable:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_27_assert_seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_26_assert_seekable[] = "NativeFile._assert_seekable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_27_assert_seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_seekable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_26_assert_seekable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_26_assert_seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__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;
  __Pyx_RefNannySetupContext("_assert_seekable", 0);

  /* "pyarrow/io.pxi":178
 * 
 *     def _assert_seekable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":179
 *     def _assert_seekable(self):
 *         self._assert_open()
 *         if not self.is_seekable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on seekable files")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":180
 *         self._assert_open()
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 180, __pyx_L1_error)

    /* "pyarrow/io.pxi":179
 *     def _assert_seekable(self):
 *         self._assert_open()
 *         if not self.is_seekable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on seekable files")
 * 
 */
  }

  /* "pyarrow/io.pxi":177
 *             raise IOError("only valid on writable files")
 * 
 *     def _assert_seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_seekable:
 */

  /* 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.lib.NativeFile._assert_seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":182
 *             raise IOError("only valid on seekable files")
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return file size
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_29size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_28size[] = "NativeFile.size(self)\n\n        Return file size\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_29size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_28size(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_28size(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int64_t __pyx_v_size;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("size", 0);

  /* "pyarrow/io.pxi":188
 *         cdef int64_t size
 * 
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(handle.get().GetSize(&size))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 188, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":189
 * 
 *         handle = self.get_random_access_file()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().GetSize(&size))
 *         return size
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":190
 *         handle = self.get_random_access_file()
 *         with nogil:
 *             check_status(handle.get().GetSize(&size))             # <<<<<<<<<<<<<<
 *         return size
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->GetSize((&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 190, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":189
 * 
 *         handle = self.get_random_access_file()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().GetSize(&size))
 *         return size
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":191
 *         with nogil:
 *             check_status(handle.get().GetSize(&size))
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def tell(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":182
 *             raise IOError("only valid on seekable files")
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return file size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":193
 *         return size
 * 
 *     def tell(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return current stream position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_31tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_30tell[] = "NativeFile.tell(self)\n\n        Return current stream position\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_31tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tell (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_30tell(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_30tell(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int64_t __pyx_v_position;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_rd_handle;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_wr_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_2;
  int __pyx_t_3;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("tell", 0);

  /* "pyarrow/io.pxi":199
 *         cdef int64_t position
 * 
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":200
 * 
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(rd_handle.get().Tell(&position))
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 200, __pyx_L1_error)
    __pyx_v_rd_handle = __pyx_t_2;

    /* "pyarrow/io.pxi":201
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(rd_handle.get().Tell(&position))
 *         else:
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":202
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 *                 check_status(rd_handle.get().Tell(&position))             # <<<<<<<<<<<<<<
 *         else:
 *             wr_handle = self.get_output_stream()
 */
          __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_rd_handle.get()->Tell((&__pyx_v_position))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 202, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":201
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(rd_handle.get().Tell(&position))
 *         else:
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":199
 *         cdef int64_t position
 * 
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":204
 *                 check_status(rd_handle.get().Tell(&position))
 *         else:
 *             wr_handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(wr_handle.get().Tell(&position))
 */
  /*else*/ {
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 204, __pyx_L1_error)
    __pyx_v_wr_handle = __pyx_t_4;

    /* "pyarrow/io.pxi":205
 *         else:
 *             wr_handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(wr_handle.get().Tell(&position))
 *         return position
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":206
 *             wr_handle = self.get_output_stream()
 *             with nogil:
 *                 check_status(wr_handle.get().Tell(&position))             # <<<<<<<<<<<<<<
 *         return position
 * 
 */
          __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_wr_handle.get()->Tell((&__pyx_v_position))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 206, __pyx_L8_error)
        }

        /* "pyarrow/io.pxi":205
 *         else:
 *             wr_handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(wr_handle.get().Tell(&position))
 *         return position
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":207
 *             with nogil:
 *                 check_status(wr_handle.get().Tell(&position))
 *         return position             # <<<<<<<<<<<<<<
 * 
 *     def seek(self, int64_t position, int whence=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_position); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":193
 *         return size
 * 
 *     def tell(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return current stream position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":209
 *         return position
 * 
 *     def seek(self, int64_t position, int whence=0):             # <<<<<<<<<<<<<<
 *         """
 *         Change current file stream position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_33seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_32seek[] = "NativeFile.seek(self, int64_t position, int whence=0)\n\n        Change current file stream position\n\n        Parameters\n        ----------\n        position : int\n            Byte offset, interpreted relative to value of whence argument\n        whence : int, default 0\n            Point of reference for seek offset\n\n        Notes\n        -----\n        Values of whence:\n        * 0 -- start of stream (the default); offset should be zero or positive\n        * 1 -- current stream position; offset may be negative\n        * 2 -- end of stream; offset is usually negative\n\n        Returns\n        -------\n        new_position : the new absolute stream position\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_33seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_position;
  int __pyx_v_whence;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_position,&__pyx_n_s_whence,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_whence);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "seek") < 0)) __PYX_ERR(6, 209, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_position = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_position == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 209, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_whence = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 209, __pyx_L3_error)
    } else {
      __pyx_v_whence = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 209, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_32seek(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_position, __pyx_v_whence);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_32seek(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, int64_t __pyx_v_position, int __pyx_v_whence) {
  int64_t __pyx_v_offset;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("seek", 0);

  /* "pyarrow/io.pxi":232
 *         """
 *         cdef int64_t offset
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 232, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":234
 *         handle = self.get_random_access_file()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if whence == 0:
 *                 offset = position
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":235
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
        switch (__pyx_v_whence) {
          case 0:

          /* "pyarrow/io.pxi":236
 *         with nogil:
 *             if whence == 0:
 *                 offset = position             # <<<<<<<<<<<<<<
 *             elif whence == 1:
 *                 check_status(handle.get().Tell(&offset))
 */
          __pyx_v_offset = __pyx_v_position;

          /* "pyarrow/io.pxi":235
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
          break;
          case 1:

          /* "pyarrow/io.pxi":238
 *                 offset = position
 *             elif whence == 1:
 *                 check_status(handle.get().Tell(&offset))             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             elif whence == 2:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Tell((&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 238, __pyx_L4_error)

          /* "pyarrow/io.pxi":239
 *             elif whence == 1:
 *                 check_status(handle.get().Tell(&offset))
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             elif whence == 2:
 *                 check_status(handle.get().GetSize(&offset))
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":237
 *             if whence == 0:
 *                 offset = position
 *             elif whence == 1:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().Tell(&offset))
 *                 offset = offset + position
 */
          break;
          case 2:

          /* "pyarrow/io.pxi":241
 *                 offset = offset + position
 *             elif whence == 2:
 *                 check_status(handle.get().GetSize(&offset))             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             else:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->GetSize((&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 241, __pyx_L4_error)

          /* "pyarrow/io.pxi":242
 *             elif whence == 2:
 *                 check_status(handle.get().GetSize(&offset))
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             else:
 *                 with gil:
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":240
 *                 check_status(handle.get().Tell(&offset))
 *                 offset = offset + position
 *             elif whence == 2:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().GetSize(&offset))
 *                 offset = offset + position
 */
          break;
          default:

          /* "pyarrow/io.pxi":244
 *                 offset = offset + position
 *             else:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 */
          {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
              #endif
              /*try:*/ {

                /* "pyarrow/io.pxi":246
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Seek(offset))
 * 
 */
                __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_of_whence_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 246, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 246, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
                  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
                  if (likely(__pyx_t_6)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                    __Pyx_INCREF(__pyx_t_6);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_4, function);
                  }
                }
                __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 246, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "pyarrow/io.pxi":245
 *             else:
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"             # <<<<<<<<<<<<<<
 *                                      .format(whence))
 *             check_status(handle.get().Seek(offset))
 */
                __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 245, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_Raise(__pyx_t_4, 0, 0, 0);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __PYX_ERR(6, 245, __pyx_L7_error)
              }

              /* "pyarrow/io.pxi":244
 *                 offset = offset + position
 *             else:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 */
              /*finally:*/ {
                __pyx_L7_error: {
                  #ifdef WITH_THREAD
                  __Pyx_PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  goto __pyx_L4_error;
                }
              }
          }
          break;
        }

        /* "pyarrow/io.pxi":247
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 *             check_status(handle.get().Seek(offset))             # <<<<<<<<<<<<<<
 * 
 *         return self.tell()
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Seek(__pyx_v_offset)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 247, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":234
 *         handle = self.get_random_access_file()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if whence == 0:
 *                 offset = position
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":249
 *             check_status(handle.get().Seek(offset))
 * 
 *         return self.tell()             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":209
 *         return position
 * 
 *     def seek(self, int64_t position, int whence=0):             # <<<<<<<<<<<<<<
 *         """
 *         Change current file stream position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":251
 *         return self.tell()
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush the stream, if applicable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_35flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_34flush[] = "NativeFile.flush(self)\n\n        Flush the stream, if applicable.\n\n        An error is raised if stream is not writable.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_35flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_34flush(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_34flush(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle;
  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;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("flush", 0);

  /* "pyarrow/io.pxi":257
 *         An error is raised if stream is not writable.
 *         """
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":259
 *         self._assert_open()
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:             # <<<<<<<<<<<<<<
 *             handle = self.get_output_stream()
 *             with nogil:
 */
  __pyx_t_4 = (__pyx_v_self->is_writable != 0);
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":260
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:
 *             handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(handle.get().Flush())
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 260, __pyx_L1_error)
    __pyx_v_handle = __pyx_t_5;

    /* "pyarrow/io.pxi":261
 *         if self.is_writable:
 *             handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().Flush())
 * 
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":262
 *             handle = self.get_output_stream()
 *             with nogil:
 *                 check_status(handle.get().Flush())             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
          __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Flush()); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 262, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":261
 *         if self.is_writable:
 *             handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().Flush())
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":259
 *         self._assert_open()
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:             # <<<<<<<<<<<<<<
 *             handle = self.get_output_stream()
 *             with nogil:
 */
  }

  /* "pyarrow/io.pxi":251
 *         return self.tell()
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush the stream, if applicable.
 */

  /* 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.lib.NativeFile.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":264
 *                 check_status(handle.get().Flush())
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Write byte from any object implementing buffer protocol (bytes,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_37write(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_36write[] = "NativeFile.write(self, data)\n\n        Write byte from any object implementing buffer protocol (bytes,\n        bytearray, ndarray, pyarrow.Buffer)\n\n        Parameters\n        ----------\n        data : bytes-like object or exporter of buffer protocol\n\n        Returns\n        -------\n        nbytes : number of bytes written\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_37write(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_36write(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_36write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data) {
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle;
  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;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_4;
  std::shared_ptr< arrow::Buffer>  __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/io.pxi":277
 *         nbytes : number of bytes written
 *         """
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 *         handle = self.get_output_stream()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":278
 *         """
 *         self._assert_writable()
 *         handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 278, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_4;

  /* "pyarrow/io.pxi":280
 *         handle = self.get_output_stream()
 * 
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_as_c_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 280, __pyx_L1_error)
  __pyx_v_buf = __pyx_t_5;

  /* "pyarrow/io.pxi":282
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().WriteBuffer(buf))
 *         return buf.get().size()
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":283
 * 
 *         with nogil:
 *             check_status(handle.get().WriteBuffer(buf))             # <<<<<<<<<<<<<<
 *         return buf.get().size()
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()-> Write(__pyx_v_buf)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 283, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":282
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().WriteBuffer(buf))
 *         return buf.get().size()
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":284
 *         with nogil:
 *             check_status(handle.get().WriteBuffer(buf))
 *         return buf.get().size()             # <<<<<<<<<<<<<<
 * 
 *     def read(self, nbytes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_buf.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":264
 *                 check_status(handle.get().Flush())
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Write byte from any object implementing buffer protocol (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.lib.NativeFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":286
 *         return buf.get().size()
 * 
 *     def read(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes from file, or read all remaining bytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_39read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_38read[] = "NativeFile.read(self, nbytes=None)\n\n        Read indicated number of bytes from file, or read all remaining bytes\n        if no argument passed\n\n        Parameters\n        ----------\n        nbytes : int, default None\n\n        Returns\n        -------\n        data : bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_39read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(6, 286, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nbytes = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 286, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_38read(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_38read(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes) {
  int64_t __pyx_v_c_nbytes;
  int64_t __pyx_v_bytes_read;
  PyObject *__pyx_v_obj;
  long __pyx_v_bs;
  PyObject *__pyx_v_chunks = NULL;
  PyObject *__pyx_v_chunk = NULL;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  uint8_t *__pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int64_t __pyx_t_8;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_9;
  PyObject *__pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pyarrow/io.pxi":301
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             PyObject* obj
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":304
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
  __pyx_t_1 = (__pyx_v_nbytes == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":305
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 */
    __pyx_t_2 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/io.pxi":307
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384             # <<<<<<<<<<<<<<
 *                 chunks = []
 *                 while True:
 */
      __pyx_v_bs = 0x4000;

      /* "pyarrow/io.pxi":308
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 *                 chunks = []             # <<<<<<<<<<<<<<
 *                 while True:
 *                     chunk = self.read(bs)
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_chunks = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/io.pxi":309
 *                 bs = 16384
 *                 chunks = []
 *                 while True:             # <<<<<<<<<<<<<<
 *                     chunk = self.read(bs)
 *                     if not chunk:
 */
      while (1) {

        /* "pyarrow/io.pxi":310
 *                 chunks = []
 *                 while True:
 *                     chunk = self.read(bs)             # <<<<<<<<<<<<<<
 *                     if not chunk:
 *                         break
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 310, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_bs); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 310, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 310, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "pyarrow/io.pxi":311
 *                 while True:
 *                     chunk = self.read(bs)
 *                     if not chunk:             # <<<<<<<<<<<<<<
 *                         break
 *                     chunks.append(chunk)
 */
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_chunk); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 311, __pyx_L1_error)
        __pyx_t_1 = ((!__pyx_t_2) != 0);
        if (__pyx_t_1) {

          /* "pyarrow/io.pxi":312
 *                     chunk = self.read(bs)
 *                     if not chunk:
 *                         break             # <<<<<<<<<<<<<<
 *                     chunks.append(chunk)
 *                 return b"".join(chunks)
 */
          goto __pyx_L6_break;

          /* "pyarrow/io.pxi":311
 *                 while True:
 *                     chunk = self.read(bs)
 *                     if not chunk:             # <<<<<<<<<<<<<<
 *                         break
 *                     chunks.append(chunk)
 */
        }

        /* "pyarrow/io.pxi":313
 *                     if not chunk:
 *                         break
 *                     chunks.append(chunk)             # <<<<<<<<<<<<<<
 *                 return b"".join(chunks)
 * 
 */
        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_chunks, __pyx_v_chunk); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 313, __pyx_L1_error)
      }
      __pyx_L6_break:;

      /* "pyarrow/io.pxi":314
 *                         break
 *                     chunks.append(chunk)
 *                 return b"".join(chunks)             # <<<<<<<<<<<<<<
 * 
 *             c_nbytes = self.size() - self.tell()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBytes_Join(__pyx_kp_b__181, __pyx_v_chunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":305
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 */
    }

    /* "pyarrow/io.pxi":316
 *                 return b"".join(chunks)
 * 
 *             c_nbytes = self.size() - self.tell()             # <<<<<<<<<<<<<<
 *         else:
 *             c_nbytes = nbytes
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 316, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_c_nbytes = __pyx_t_8;

    /* "pyarrow/io.pxi":304
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":318
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         handle = self.get_input_stream()
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 318, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":320
 *             c_nbytes = nbytes
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         # Allocate empty write space
 */
  __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 320, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_9;

  /* "pyarrow/io.pxi":323
 * 
 *         # Allocate empty write space
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)             # <<<<<<<<<<<<<<
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 */
  __pyx_t_10 =  PyBytes_FromStringAndSize(NULL, __pyx_v_c_nbytes); if (unlikely(__pyx_t_10 == ((PyObject *)NULL))) __PYX_ERR(6, 323, __pyx_L1_error)
  __pyx_v_obj = __pyx_t_10;

  /* "pyarrow/io.pxi":325
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 */
  __pyx_v_buf = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_obj)));

  /* "pyarrow/io.pxi":326
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":327
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))             # <<<<<<<<<<<<<<
 * 
 *         if bytes_read < c_nbytes:
 */
        __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Read(__pyx_v_c_nbytes, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(6, 327, __pyx_L9_error)
      }

      /* "pyarrow/io.pxi":326
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L10;
        }
        __pyx_L9_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L10:;
      }
  }

  /* "pyarrow/io.pxi":329
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  __pyx_t_1 = ((__pyx_v_bytes_read < __pyx_v_c_nbytes) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":330
 * 
 *         if bytes_read < c_nbytes:
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(obj)
 */
    __pyx_t_11 = _PyBytes_Resize((&__pyx_v_obj), ((Py_ssize_t)__pyx_v_bytes_read)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(6, 330, __pyx_L1_error)

    /* "pyarrow/io.pxi":329
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  }

  /* "pyarrow/io.pxi":332
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 *         return PyObject_to_object(obj)             # <<<<<<<<<<<<<<
 * 
 *     def read_at(self, nbytes, offset):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":286
 *         return buf.get().size()
 * 
 *     def read(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes from file, or read all remaining bytes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chunks);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":334
 *         return PyObject_to_object(obj)
 * 
 *     def read_at(self, nbytes, offset):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes at offset from the file
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_41read_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_40read_at[] = "NativeFile.read_at(self, nbytes, offset)\n\n        Read indicated number of bytes at offset from the file\n\n        Parameters\n        ----------\n        nbytes : int\n        offset : int\n\n        Returns\n        -------\n        data : bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_41read_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_at (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,&__pyx_n_s_offset,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_at", 1, 2, 2, 1); __PYX_ERR(6, 334, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_at") < 0)) __PYX_ERR(6, 334, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_nbytes = values[0];
    __pyx_v_offset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 334, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_40read_at(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes, __pyx_v_offset);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_40read_at(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_offset) {
  int64_t __pyx_v_c_nbytes;
  int64_t __pyx_v_c_offset;
  int64_t __pyx_v_bytes_read;
  PyObject *__pyx_v_obj;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle;
  uint8_t *__pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_2;
  PyObject *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("read_at", 0);

  /* "pyarrow/io.pxi":350
 *             int64_t c_nbytes
 *             int64_t c_offset
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             PyObject* obj
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":353
 *             PyObject* obj
 * 
 *         c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         c_offset = offset
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 353, __pyx_L1_error)
  __pyx_v_c_nbytes = __pyx_t_1;

  /* "pyarrow/io.pxi":355
 *         c_nbytes = nbytes
 * 
 *         c_offset = offset             # <<<<<<<<<<<<<<
 * 
 *         handle = self.get_random_access_file()
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 355, __pyx_L1_error)
  __pyx_v_c_offset = __pyx_t_1;

  /* "pyarrow/io.pxi":357
 *         c_offset = offset
 * 
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 *         # Allocate empty write space
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 357, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_2;

  /* "pyarrow/io.pxi":360
 * 
 *         # Allocate empty write space
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)             # <<<<<<<<<<<<<<
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 */
  __pyx_t_3 =  PyBytes_FromStringAndSize(NULL, __pyx_v_c_nbytes); if (unlikely(__pyx_t_3 == ((PyObject *)NULL))) __PYX_ERR(6, 360, __pyx_L1_error)
  __pyx_v_obj = __pyx_t_3;

  /* "pyarrow/io.pxi":362
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(handle.get().
 */
  __pyx_v_buf = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_obj)));

  /* "pyarrow/io.pxi":363
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().
 *                          ReadAt(c_offset, c_nbytes, &bytes_read, buf))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":364
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:
 *             check_status(handle.get().             # <<<<<<<<<<<<<<
 *                          ReadAt(c_offset, c_nbytes, &bytes_read, buf))
 * 
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->ReadAt(__pyx_v_c_offset, __pyx_v_c_nbytes, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 364, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":363
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().
 *                          ReadAt(c_offset, c_nbytes, &bytes_read, buf))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":367
 *                          ReadAt(c_offset, c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  __pyx_t_5 = ((__pyx_v_bytes_read < __pyx_v_c_nbytes) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":368
 * 
 *         if bytes_read < c_nbytes:
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(obj)
 */
    __pyx_t_4 = _PyBytes_Resize((&__pyx_v_obj), ((Py_ssize_t)__pyx_v_bytes_read)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 368, __pyx_L1_error)

    /* "pyarrow/io.pxi":367
 *                          ReadAt(c_offset, c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  }

  /* "pyarrow/io.pxi":370
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 *         return PyObject_to_object(obj)             # <<<<<<<<<<<<<<
 * 
 *     def read1(self, nbytes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":334
 *         return PyObject_to_object(obj)
 * 
 *     def read_at(self, nbytes, offset):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes at offset from the file
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":372
 *         return PyObject_to_object(obj)
 * 
 *     def read1(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """Read and return up to n bytes.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_43read1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_42read1[] = "NativeFile.read1(self, nbytes=None)\nRead and return up to n bytes.\n\n        Alias for read, needed to match the IOBase interface.";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_43read1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read1 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read1") < 0)) __PYX_ERR(6, 372, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nbytes = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read1", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 372, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_42read1(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_42read1(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_nbytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read1", 0);

  /* "pyarrow/io.pxi":376
 * 
 *         Alias for read, needed to match the IOBase interface."""
 *         return self.read(nbytes=None)             # <<<<<<<<<<<<<<
 * 
 *     def readall(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nbytes, Py_None) < 0) __PYX_ERR(6, 376, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":372
 *         return PyObject_to_object(obj)
 * 
 *     def read1(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """Read and return up to n 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.lib.NativeFile.read1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":378
 *         return self.read(nbytes=None)
 * 
 *     def readall(self):             # <<<<<<<<<<<<<<
 *         return self.read()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_45readall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_44readall[] = "NativeFile.readall(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_45readall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readall (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_44readall(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_44readall(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readall", 0);

  /* "pyarrow/io.pxi":379
 * 
 *     def readall(self):
 *         return self.read()             # <<<<<<<<<<<<<<
 * 
 *     def readinto(self, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 379, __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/io.pxi":378
 *         return self.read(nbytes=None)
 * 
 *     def readall(self):             # <<<<<<<<<<<<<<
 *         return self.read()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readall", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":381
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_47readinto(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_46readinto[] = "NativeFile.readinto(self, b)\n\n        Read into the supplied buffer\n\n        Parameters\n        -----------\n        b: any python object supporting buffer interface\n\n        Returns\n        --------\n        number of bytes written\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_47readinto(PyObject *__pyx_v_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readinto (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_46readinto(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_46readinto(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_b) {
  int64_t __pyx_v_bytes_read;
  uint8_t *__pyx_v_buf;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_py_buf = 0;
  int64_t __pyx_v_buf_len;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("readinto", 0);

  /* "pyarrow/io.pxi":400
 *             int64_t buf_len
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         py_buf = py_buffer(b)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 400, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":402
 *         handle = self.get_input_stream()
 * 
 *         py_buf = py_buffer(b)             # <<<<<<<<<<<<<<
 *         buf_len = py_buf.size
 *         buf = py_buf.buffer.get().mutable_data()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_b);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(6, 402, __pyx_L1_error)
  __pyx_v_py_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":403
 * 
 *         py_buf = py_buffer(b)
 *         buf_len = py_buf.size             # <<<<<<<<<<<<<<
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_py_buf), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buf_len = __pyx_t_5;

  /* "pyarrow/io.pxi":404
 *         py_buf = py_buffer(b)
 *         buf_len = py_buf.size
 *         buf = py_buf.buffer.get().mutable_data()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_buf = __pyx_v_py_buf->buffer.get()->mutable_data();

  /* "pyarrow/io.pxi":406
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Read(buf_len, &bytes_read, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":407
 * 
 *         with nogil:
 *             check_status(handle.get().Read(buf_len, &bytes_read, buf))             # <<<<<<<<<<<<<<
 * 
 *         return bytes_read
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Read(__pyx_v_buf_len, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 407, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":406
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Read(buf_len, &bytes_read, buf))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":409
 *             check_status(handle.get().Read(buf_len, &bytes_read, buf))
 * 
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def readline(self, size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":381
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":411
 *         return bytes_read
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read and return a line of bytes from the file.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_49readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_48readline[] = "NativeFile.readline(self, size=None)\nNOT IMPLEMENTED. Read and return a line of bytes from the file.\n\n        If size is specified, read at most size bytes.\n\n        Line terminator is always b\"\\n\".\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_49readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readline (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readline") < 0)) __PYX_ERR(6, 411, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readline", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 411, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_48readline(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_48readline(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readline", 0);

  /* "pyarrow/io.pxi":419
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def readlines(self, hint=None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 419, __pyx_L1_error)

  /* "pyarrow/io.pxi":411
 *         return bytes_read
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read and return a line of bytes from the file.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":421
 *         raise UnsupportedOperation()
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read lines of the file
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_50readlines[] = "NativeFile.readlines(self, hint=None)\nNOT IMPLEMENTED. Read lines of the file\n\n        Parameters\n        -----------\n\n        hint: int maximum number of bytes read until we stop\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_hint = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readlines (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readlines") < 0)) __PYX_ERR(6, 421, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readlines", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 421, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_50readlines(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_hint);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_50readlines(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hint) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readlines", 0);

  /* "pyarrow/io.pxi":430
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 430, __pyx_L1_error)

  /* "pyarrow/io.pxi":421
 *         raise UnsupportedOperation()
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read lines of the file
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":432
 *         raise UnsupportedOperation()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_52__iter__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_52__iter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pyarrow/io.pxi":433
 * 
 *     def __iter__(self):
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":434
 *     def __iter__(self):
 *         self._assert_readable()
 *         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/io.pxi":432
 *         raise UnsupportedOperation()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":436
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         line = self.readline()
 *         if not line:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_54__next__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_54__next__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_v_line = NULL;
  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_t_5;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pyarrow/io.pxi":437
 * 
 *     def __next__(self):
 *         line = self.readline()             # <<<<<<<<<<<<<<
 *         if not line:
 *             raise StopIteration
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_line = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":438
 *     def __next__(self):
 *         line = self.readline()
 *         if not line:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return line
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_line); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 438, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":439
 *         line = self.readline()
 *         if not line:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return line
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(6, 439, __pyx_L1_error)

    /* "pyarrow/io.pxi":438
 *     def __next__(self):
 *         line = self.readline()
 *         if not line:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return line
 */
  }

  /* "pyarrow/io.pxi":440
 *         if not line:
 *             raise StopIteration
 *         return line             # <<<<<<<<<<<<<<
 * 
 *     def read_buffer(self, nbytes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_line);
  __pyx_r = __pyx_v_line;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":436
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         line = self.readline()
 *         if not line:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":442
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57read_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_56read_buffer[] = "NativeFile.read_buffer(self, nbytes=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57read_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_buffer") < 0)) __PYX_ERR(6, 442, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nbytes = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_buffer", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 442, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_56read_buffer(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_56read_buffer(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes) {
  int64_t __pyx_v_c_nbytes;
  CYTHON_UNUSED int64_t __pyx_v_bytes_read;
  std::shared_ptr< arrow::Buffer>  __pyx_v_output;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::InputStream>  __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;
  PyObject *__pyx_t_8 = NULL;
  int64_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("read_buffer", 0);

  /* "pyarrow/io.pxi":445
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] output
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":448
 *             shared_ptr[CBuffer] output
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         if nbytes is None:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 448, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":450
 *         handle = self.get_input_stream()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
  __pyx_t_2 = (__pyx_v_nbytes == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":451
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 */
    __pyx_t_3 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
    if (__pyx_t_3) {

      /* "pyarrow/io.pxi":453
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())             # <<<<<<<<<<<<<<
 *             c_nbytes = self.size() - self.tell()
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":451
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 */
    }

    /* "pyarrow/io.pxi":454
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 *             c_nbytes = self.size() - self.tell()             # <<<<<<<<<<<<<<
 *         else:
 *             c_nbytes = nbytes
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 454, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_c_nbytes = __pyx_t_9;

    /* "pyarrow/io.pxi":450
 *         handle = self.get_input_stream()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":456
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 456, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_9;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":458
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().ReadBuffer(c_nbytes, &output))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":459
 * 
 *         with nogil:
 *             check_status(handle.get().ReadBuffer(c_nbytes, &output))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_buffer(output)
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()-> Read(__pyx_v_c_nbytes, (&__pyx_v_output))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 459, __pyx_L6_error)
      }

      /* "pyarrow/io.pxi":458
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().ReadBuffer(c_nbytes, &output))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/io.pxi":461
 *             check_status(handle.get().ReadBuffer(c_nbytes, &output))
 * 
 *         return pyarrow_wrap_buffer(output)             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_output); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":442
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

  /* 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.lib.NativeFile.read_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":463
 *         return pyarrow_wrap_buffer(output)
 * 
 *     def truncate(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_59truncate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_58truncate[] = "NativeFile.truncate(self)\n\n        NOT IMPLEMENTED\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_59truncate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_58truncate(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_58truncate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);

  /* "pyarrow/io.pxi":467
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def writelines(self, lines):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 467, __pyx_L1_error)

  /* "pyarrow/io.pxi":463
 *         return pyarrow_wrap_buffer(output)
 * 
 *     def truncate(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":469
 *         raise UnsupportedOperation()
 * 
 *     def writelines(self, lines):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_61writelines(PyObject *__pyx_v_self, PyObject *__pyx_v_lines); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_60writelines[] = "NativeFile.writelines(self, lines)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_61writelines(PyObject *__pyx_v_self, PyObject *__pyx_v_lines) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writelines (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_60writelines(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v_lines));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_60writelines(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_lines) {
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("writelines", 0);

  /* "pyarrow/io.pxi":470
 * 
 *     def writelines(self, lines):
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 * 
 *         for line in lines:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":472
 *         self._assert_writable()
 * 
 *         for line in lines:             # <<<<<<<<<<<<<<
 *             self.write(line)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_lines)) || PyTuple_CheckExact(__pyx_v_lines)) {
    __pyx_t_1 = __pyx_v_lines; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 472, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 472, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 472, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 472, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":473
 * 
 *         for line in lines:
 *             self.write(line)             # <<<<<<<<<<<<<<
 * 
 *     def download(self, stream_or_path, buffer_size=None):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_line) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_line);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":472
 *         self._assert_writable()
 * 
 *         for line in lines:             # <<<<<<<<<<<<<<
 *             self.write(line)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":469
 *         raise UnsupportedOperation()
 * 
 *     def writelines(self, lines):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */

  /* 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.lib.NativeFile.writelines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":475
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_63download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_62download[] = "NativeFile.download(self, stream_or_path, buffer_size=None)\n\n        Read file completely to local path (rather than reading completely into\n        memory). First seeks to the beginning of the file.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_63download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stream_or_path = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("download (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream_or_path,&__pyx_n_s_buffer_size,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream_or_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "download") < 0)) __PYX_ERR(6, 475, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream_or_path = values[0];
    __pyx_v_buffer_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("download", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 475, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_62download(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_stream_or_path, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":493
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_8download_1cleanup = {"cleanup", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_8download_1cleanup, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8download_cleanup(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_cleanup(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("cleanup", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":494
 * 
 *             def cleanup():
 *                 stream.close()             # <<<<<<<<<<<<<<
 *         else:
 *             stream = stream_or_path
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_stream)) { __Pyx_RaiseClosureNameError("stream"); __PYX_ERR(6, 494, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stream, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":493
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */

  /* 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.lib.NativeFile.download.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":498
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_3cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_8download_3cleanup = {"cleanup", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_8download_3cleanup, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_3cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8download_2cleanup(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_2cleanup(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":504
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_5bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_8download_5bg_write = {"bg_write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_8download_5bg_write, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_5bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bg_write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8download_4bg_write(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_4bg_write(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *__pyx_outer_scope;
  PyObject *__pyx_v_buf = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_exc_info = NULL;
  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_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  char const *__pyx_t_21;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":505
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
  /*try:*/ {
    {
      __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/io.pxi":506
 *         def bg_write():
 *             try:
 *                 while not done or write_queue.qsize() > 0:             # <<<<<<<<<<<<<<
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 */
        while (1) {
          __pyx_t_5 = ((!(__pyx_cur_scope->__pyx_v_done != 0)) != 0);
          if (!__pyx_t_5) {
          } else {
            __pyx_t_4 = __pyx_t_5;
            goto __pyx_L14_bool_binop_done;
          }
          if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(6, 506, __pyx_L6_error) }
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_qsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 506, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 506, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 506, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 506, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_4 = __pyx_t_5;
          __pyx_L14_bool_binop_done:;
          if (!__pyx_t_4) break;

          /* "pyarrow/io.pxi":507
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            /*try:*/ {

              /* "pyarrow/io.pxi":508
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)             # <<<<<<<<<<<<<<
 *                     except QueueEmpty:
 *                         continue
 */
              if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(6, 508, __pyx_L16_error) }
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 508, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 508, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_6);
              if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_timeout, __pyx_float_0_01) < 0) __PYX_ERR(6, 508, __pyx_L16_error)
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 508, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_8);
              __pyx_t_8 = 0;

              /* "pyarrow/io.pxi":507
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
            }
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L23_try_end;
            __pyx_L16_error:;
            __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/io.pxi":509
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:             # <<<<<<<<<<<<<<
 *                         continue
 *                     stream.write(buf)
 */
            __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7);
            __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_QueueEmpty); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 509, __pyx_L18_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_8, __pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_ErrRestore(__pyx_t_8, __pyx_t_6, __pyx_t_7);
            __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
            if (__pyx_t_13) {
              __Pyx_AddTraceback("pyarrow.lib.NativeFile.download.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(6, 509, __pyx_L18_except_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_GOTREF(__pyx_t_8);

              /* "pyarrow/io.pxi":510
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 *                         continue             # <<<<<<<<<<<<<<
 *                     stream.write(buf)
 *             except Exception as e:
 */
              goto __pyx_L25_except_continue;
              __pyx_L25_except_continue:;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              goto __pyx_L22_try_continue;
            }
            goto __pyx_L18_except_error;
            __pyx_L18_except_error:;

            /* "pyarrow/io.pxi":507
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            goto __pyx_L6_error;
            __pyx_L22_try_continue:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            goto __pyx_L12_continue;
            __pyx_L23_try_end:;
          }

          /* "pyarrow/io.pxi":511
 *                     except QueueEmpty:
 *                         continue
 *                     stream.write(buf)             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 exc_info = sys.exc_info()
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_stream)) { __Pyx_RaiseClosureNameError("stream"); __PYX_ERR(6, 511, __pyx_L6_error) }
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 511, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_buf);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 511, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_L12_continue:;
        }

        /* "pyarrow/io.pxi":505
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
      }
      __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_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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/io.pxi":512
 *                         continue
 *                     stream.write(buf)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 *             finally:
 */
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_13) {
        __Pyx_AddTraceback("pyarrow.lib.NativeFile.download.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(6, 512, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_v_e = __pyx_t_6;
        /*try:*/ {

          /* "pyarrow/io.pxi":513
 *                     stream.write(buf)
 *             except Exception as e:
 *                 exc_info = sys.exc_info()             # <<<<<<<<<<<<<<
 *             finally:
 *                 cleanup()
 */
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 513, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 513, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 513, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_v_exc_info = __pyx_t_12;
          __pyx_t_12 = 0;
        }

        /* "pyarrow/io.pxi":512
 *                         continue
 *                     stream.write(buf)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 *             finally:
 */
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
            goto __pyx_L32;
          }
          __pyx_L31_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e);
              __pyx_v_e = NULL;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __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_11);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
            __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
            goto __pyx_L8_except_error;
          }
          __pyx_L32:;
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "pyarrow/io.pxi":505
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
      __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_L4_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      __pyx_L11_try_end:;
    }
  }

  /* "pyarrow/io.pxi":515
 *                 exc_info = sys.exc_info()
 *             finally:
 *                 cleanup()             # <<<<<<<<<<<<<<
 * 
 *         self.seek(0)
 */
  /*finally:*/ {
    /*normal exit:*/{
      if (unlikely(!__pyx_cur_scope->__pyx_v_cleanup)) { __Pyx_RaiseClosureNameError("cleanup"); __PYX_ERR(6, 515, __pyx_L1_error) }
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 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;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      __pyx_t_16 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
      {
        if (unlikely(!__pyx_cur_scope->__pyx_v_cleanup)) { __Pyx_RaiseClosureNameError("cleanup"); __PYX_ERR(6, 515, __pyx_L38_error) }
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 515, __pyx_L38_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      }
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_21;
      goto __pyx_L1_error;
      __pyx_L38_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "pyarrow/io.pxi":504
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":475
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_62download(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream_or_path, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *__pyx_cur_scope;
  int64_t __pyx_v_bytes_read;
  uint8_t *__pyx_v_buf;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_v_bg_write = 0;
  PyObject *__pyx_v_writer_thread = NULL;
  int64_t __pyx_v_total_bytes;
  int32_t __pyx_v_c_buffer_size;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  int32_t __pyx_t_8;
  int __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;
  __Pyx_RefNannySetupContext("download", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10_download(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10_download, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 475, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_buffer_size);

  /* "pyarrow/io.pxi":481
 *         """
 *         cdef:
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             uint8_t* buf
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":484
 *             uint8_t* buf
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 484, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":486
 *         handle = self.get_input_stream()
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE             # <<<<<<<<<<<<<<
 * 
 *         write_queue = Queue(50)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 486, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_2 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_BUFFER_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":488
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         write_queue = Queue(50)             # <<<<<<<<<<<<<<
 * 
 *         if not hasattr(stream_or_path, 'read'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Queue); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_int_50) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_50);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_write_queue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":490
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_stream_or_path, __pyx_n_u_read); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 490, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":491
 * 
 *         if not hasattr(stream_or_path, 'read'):
 *             stream = open(stream_or_path, 'wb')             # <<<<<<<<<<<<<<
 * 
 *             def cleanup():
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_stream_or_path);
    __Pyx_GIVEREF(__pyx_v_stream_or_path);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream_or_path);
    __Pyx_INCREF(__pyx_n_u_wb);
    __Pyx_GIVEREF(__pyx_n_u_wb);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_wb);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_stream = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":493
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_1cleanup, 0, __pyx_n_s_download_locals_cleanup, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":490
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
    goto __pyx_L5;
  }

  /* "pyarrow/io.pxi":496
 *                 stream.close()
 *         else:
 *             stream = stream_or_path             # <<<<<<<<<<<<<<
 * 
 *             def cleanup():
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_stream_or_path);
    __Pyx_GIVEREF(__pyx_v_stream_or_path);
    __pyx_cur_scope->__pyx_v_stream = __pyx_v_stream_or_path;

    /* "pyarrow/io.pxi":498
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_3cleanup, 0, __pyx_n_s_download_locals_cleanup, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L5:;

  /* "pyarrow/io.pxi":501
 *                 pass
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":502
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":504
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_5bg_write, 0, __pyx_n_s_download_locals_bg_write, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_bg_write = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":517
 *                 cleanup()
 * 
 *         self.seek(0)             # <<<<<<<<<<<<<<
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_0);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":519
 *         self.seek(0)
 * 
 *         writer_thread = threading.Thread(target=bg_write)             # <<<<<<<<<<<<<<
 * 
 *         # This isn't ideal -- PyBytes_FromStringAndSize copies the data from
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_target, __pyx_v_bg_write) < 0) __PYX_ERR(6, 519, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_writer_thread = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/io.pxi":523
 *         # This isn't ideal -- PyBytes_FromStringAndSize copies the data from
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)             # <<<<<<<<<<<<<<
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"
 */
  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 523, __pyx_L1_error)
  __pyx_v_buf = ((uint8_t *)malloc(__pyx_t_7));

  /* "pyarrow/io.pxi":524
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))
 */
  __pyx_t_6 = ((__pyx_v_buf == NULL) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/io.pxi":526
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.start()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Failed_to_allocate_0_bytes, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_buffer_size);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":525
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"             # <<<<<<<<<<<<<<
 *                               .format(buffer_size))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(6, 525, __pyx_L1_error)

    /* "pyarrow/io.pxi":524
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))
 */
  }

  /* "pyarrow/io.pxi":528
 *                               .format(buffer_size))
 * 
 *         writer_thread.start()             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t total_bytes = 0
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":530
 *         writer_thread.start()
 * 
 *         cdef int64_t total_bytes = 0             # <<<<<<<<<<<<<<
 *         cdef int32_t c_buffer_size = buffer_size
 * 
 */
  __pyx_v_total_bytes = 0;

  /* "pyarrow/io.pxi":531
 * 
 *         cdef int64_t total_bytes = 0
 *         cdef int32_t c_buffer_size = buffer_size             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 531, __pyx_L1_error)
  __pyx_v_c_buffer_size = __pyx_t_8;

  /* "pyarrow/io.pxi":533
 *         cdef int32_t c_buffer_size = buffer_size
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 with nogil:
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":534
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     check_status(handle.get()
 */
    while (1) {

      /* "pyarrow/io.pxi":535
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_status(handle.get()
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io.pxi":536
 *             while True:
 *                 with nogil:
 *                     check_status(handle.get()             # <<<<<<<<<<<<<<
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 * 
 */
            __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Read(__pyx_v_c_buffer_size, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 536, __pyx_L15_error)
          }

          /* "pyarrow/io.pxi":535
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_status(handle.get()
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L16;
            }
            __pyx_L15_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L8_error;
            }
            __pyx_L16:;
          }
      }

      /* "pyarrow/io.pxi":539
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 * 
 *                 total_bytes += bytes_read             # <<<<<<<<<<<<<<
 * 
 *                 # EOF
 */
      __pyx_v_total_bytes = (__pyx_v_total_bytes + __pyx_v_bytes_read);

      /* "pyarrow/io.pxi":542
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_6 = ((__pyx_v_bytes_read == 0) != 0);
      if (__pyx_t_6) {

        /* "pyarrow/io.pxi":543
 *                 # EOF
 *                 if bytes_read == 0:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,
 */
        goto __pyx_L11_break;

        /* "pyarrow/io.pxi":542
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":545
 *                     break
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,             # <<<<<<<<<<<<<<
 *                                                      bytes_read)
 * 
 */
      __pyx_t_4 = PyBytes_FromStringAndSize(((char const *)__pyx_v_buf), __pyx_v_bytes_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 545, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_pybuf, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":548
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 548, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 548, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 548, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {

        /* "pyarrow/io.pxi":549
 * 
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():             # <<<<<<<<<<<<<<
 *                         time.sleep(0.01)
 *                 else:
 */
        while (1) {
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_full); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 549, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 549, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 549, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (!__pyx_t_6) break;

          /* "pyarrow/io.pxi":550
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():
 *                         time.sleep(0.01)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 550, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sleep); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 550, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_float_0_01) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_float_0_01);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 550, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }

        /* "pyarrow/io.pxi":548
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L18;
      }

      /* "pyarrow/io.pxi":552
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(pybuf)
 */
      /*else*/ {
        goto __pyx_L11_break;
      }
      __pyx_L18:;

      /* "pyarrow/io.pxi":554
 *                     break
 * 
 *                 write_queue.put_nowait(pybuf)             # <<<<<<<<<<<<<<
 *         finally:
 *             free(buf)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 554, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_pybuf) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pybuf);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 554, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L11_break:;
  }

  /* "pyarrow/io.pxi":556
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      free(__pyx_v_buf);

      /* "pyarrow/io.pxi":557
 *         finally:
 *             free(buf)
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
      __pyx_cur_scope->__pyx_v_done = 1;
      goto __pyx_L9;
    }
    __pyx_L8_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_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || 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_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {

        /* "pyarrow/io.pxi":556
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
        free(__pyx_v_buf);

        /* "pyarrow/io.pxi":557
 *         finally:
 *             free(buf)
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
        __pyx_cur_scope->__pyx_v_done = 1;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __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_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
    }
    __pyx_L9:;
  }

  /* "pyarrow/io.pxi":559
 *             done = True
 * 
 *         writer_thread.join()             # <<<<<<<<<<<<<<
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":560
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  __pyx_t_6 = (__pyx_v_exc_info != Py_None);
  __pyx_t_3 = (__pyx_t_6 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/io.pxi":561
 *         writer_thread.join()
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]             # <<<<<<<<<<<<<<
 * 
 *     def upload(self, stream, buffer_size=None):
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_4, __pyx_t_2, __pyx_t_5, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 561, __pyx_L1_error)

    /* "pyarrow/io.pxi":560
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":475
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_v_bg_write);
  __Pyx_XDECREF(__pyx_v_writer_thread);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":563
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_65upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_64upload[] = "NativeFile.upload(self, stream, buffer_size=None)\n\n        Pipe file-like object to file\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_65upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upload (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "upload") < 0)) __PYX_ERR(6, 563, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = values[0];
    __pyx_v_buffer_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upload", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 563, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_64upload(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":575
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6upload_1bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_6upload_1bg_write = {"bg_write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_6upload_1bg_write, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6upload_1bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bg_write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_6upload_bg_write(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6upload_bg_write(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *__pyx_outer_scope;
  PyObject *__pyx_v_buf = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_exc_info = NULL;
  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_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":576
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
  {
    __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/io.pxi":577
 *         def bg_write():
 *             try:
 *                 while not done or write_queue.qsize() > 0:             # <<<<<<<<<<<<<<
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 */
      while (1) {
        __pyx_t_5 = ((!(__pyx_cur_scope->__pyx_v_done != 0)) != 0);
        if (!__pyx_t_5) {
        } else {
          __pyx_t_4 = __pyx_t_5;
          goto __pyx_L11_bool_binop_done;
        }
        if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(6, 577, __pyx_L3_error) }
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_qsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 577, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 577, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 577, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 577, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_4 = __pyx_t_5;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_4) break;

        /* "pyarrow/io.pxi":578
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "pyarrow/io.pxi":579
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)             # <<<<<<<<<<<<<<
 *                     except QueueEmpty:
 *                         continue
 */
            if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(6, 579, __pyx_L13_error) }
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 579, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 579, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_timeout, __pyx_float_0_01) < 0) __PYX_ERR(6, 579, __pyx_L13_error)
            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 579, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "pyarrow/io.pxi":578
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L20_try_end;
          __pyx_L13_error:;
          __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/io.pxi":580
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
          __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7);
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_QueueEmpty); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 580, __pyx_L15_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_8, __pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_ErrRestore(__pyx_t_8, __pyx_t_6, __pyx_t_7);
          __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
          if (__pyx_t_13) {
            __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(6, 580, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_t_8);

            /* "pyarrow/io.pxi":581
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *                     self.write(buf)
 */
            goto __pyx_L22_except_continue;
            __pyx_L22_except_continue:;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L19_try_continue;
          }
          goto __pyx_L15_except_error;
          __pyx_L15_except_error:;

          /* "pyarrow/io.pxi":578
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L3_error;
          __pyx_L19_try_continue:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L9_continue;
          __pyx_L20_try_end:;
        }

        /* "pyarrow/io.pxi":583
 *                         continue
 * 
 *                     self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *             except Exception as e:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(6, 583, __pyx_L3_error) }
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 583, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_buf);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 583, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_L9_continue:;
      }

      /* "pyarrow/io.pxi":576
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
    }
    __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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":585
 *                     self.write(buf)
 * 
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(6, 585, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_e = __pyx_t_6;
      /*try:*/ {

        /* "pyarrow/io.pxi":586
 * 
 *             except Exception as e:
 *                 exc_info = sys.exc_info()             # <<<<<<<<<<<<<<
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 586, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 586, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 586, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_v_exc_info = __pyx_t_12;
        __pyx_t_12 = 0;
      }

      /* "pyarrow/io.pxi":585
 *                     self.write(buf)
 * 
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e);
          __pyx_v_e = NULL;
          goto __pyx_L29;
        }
        __pyx_L28_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __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_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L5_except_error;
        }
        __pyx_L29:;
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":576
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
    __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_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/io.pxi":575
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":563
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_64upload(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *__pyx_cur_scope;
  PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_v_bg_write = 0;
  PyObject *__pyx_v_writer_thread = NULL;
  PyObject *__pyx_v_buf = NULL;
  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_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  char const *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("upload", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_upload(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11_upload, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 563, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_v_buffer_size);

  /* "pyarrow/io.pxi":567
 *         Pipe file-like object to file
 *         """
 *         write_queue = Queue(50)             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_50) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_50);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_write_queue = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":568
 *         """
 *         write_queue = Queue(50)
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":570
 *         self._assert_writable()
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE             # <<<<<<<<<<<<<<
 * 
 *         done = False
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 570, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_1 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_BUFFER_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":572
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":573
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":575
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_6upload_1bg_write, 0, __pyx_n_s_upload_locals_bg_write, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bg_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":588
 *                 exc_info = sys.exc_info()
 * 
 *         writer_thread = threading.Thread(target=bg_write)             # <<<<<<<<<<<<<<
 *         writer_thread.start()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target, __pyx_v_bg_write) < 0) __PYX_ERR(6, 588, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_writer_thread = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":589
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 *         writer_thread.start()             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":591
 *         writer_thread.start()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 buf = stream.read(buffer_size)
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":592
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 */
    while (1) {

      /* "pyarrow/io.pxi":593
 *         try:
 *             while True:
 *                 buf = stream.read(buffer_size)             # <<<<<<<<<<<<<<
 *                 if not buf:
 *                     break
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 593, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_buffer_size);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 593, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/io.pxi":594
 *             while True:
 *                 buf = stream.read(buffer_size)
 *                 if not buf:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_buf); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 594, __pyx_L6_error)
      __pyx_t_5 = ((!__pyx_t_4) != 0);
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":595
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 if writer_thread.is_alive():
 */
        goto __pyx_L9_break;

        /* "pyarrow/io.pxi":594
 *             while True:
 *                 buf = stream.read(buffer_size)
 *                 if not buf:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":597
 *                     break
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 597, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 597, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 597, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":598
 * 
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():             # <<<<<<<<<<<<<<
 *                         time.sleep(0.01)
 *                 else:
 */
        while (1) {
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 598, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 598, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 598, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (!__pyx_t_5) break;

          /* "pyarrow/io.pxi":599
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():
 *                         time.sleep(0.01)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 599, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sleep); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 599, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_float_0_01) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_float_0_01);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 599, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }

        /* "pyarrow/io.pxi":597
 *                     break
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L11;
      }

      /* "pyarrow/io.pxi":601
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(buf)
 */
      /*else*/ {
        goto __pyx_L9_break;
      }
      __pyx_L11:;

      /* "pyarrow/io.pxi":603
 *                     break
 * 
 *                 write_queue.put_nowait(buf)             # <<<<<<<<<<<<<<
 *         finally:
 *             done = True
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 603, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_buf);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 603, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L9_break:;
  }

  /* "pyarrow/io.pxi":605
 *                 write_queue.put_nowait(buf)
 *         finally:
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_cur_scope->__pyx_v_done = 1;
      goto __pyx_L7;
    }
    __pyx_L6_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __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;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
      {
        __pyx_cur_scope->__pyx_v_done = 1;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "pyarrow/io.pxi":607
 *             done = True
 * 
 *         writer_thread.join()             # <<<<<<<<<<<<<<
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":608
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  __pyx_t_5 = (__pyx_v_exc_info != Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":609
 *         writer_thread.join()
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]             # <<<<<<<<<<<<<<
 * 
 * BufferedIOBase.register(NativeFile)
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_3, __pyx_t_2, __pyx_t_1, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 609, __pyx_L1_error)

    /* "pyarrow/io.pxi":608
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":563
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */

  /* 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.lib.NativeFile.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_v_bg_write);
  __Pyx_XDECREF(__pyx_v_writer_thread);
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_67__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_66__reduce_cython__[] = "NativeFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_67__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_66__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_66__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__188, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_69__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_68__setstate_cython__[] = "NativeFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_69__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_68__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_68__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":631
 *         object handle
 * 
 *     def __cinit__(self, handle, mode=None):             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_10PythonFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_10PythonFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_handle = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 631, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_handle = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 631, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode) {
  PyObject *__pyx_v_inferred_mode = NULL;
  PyObject *__pyx_v_kind = NULL;
  int __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 = NULL;
  int __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;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":632
 * 
 *     def __cinit__(self, handle, mode=None):
 *         self.handle = handle             # <<<<<<<<<<<<<<
 * 
 *         if mode is None:
 */
  __Pyx_INCREF(__pyx_v_handle);
  __Pyx_GIVEREF(__pyx_v_handle);
  __Pyx_GOTREF(__pyx_v_self->handle);
  __Pyx_DECREF(__pyx_v_self->handle);
  __pyx_v_self->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":634
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 inferred_mode = handle.mode
 */
  __pyx_t_1 = (__pyx_v_mode == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":635
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "pyarrow/io.pxi":636
 *         if mode is None:
 *             try:
 *                 inferred_mode = handle.mode             # <<<<<<<<<<<<<<
 *             except AttributeError:
 *                 # Not all file-like objects have a mode attribute
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 636, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_v_inferred_mode = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "pyarrow/io.pxi":635
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
      }
      __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;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/io.pxi":637
 *             try:
 *                 inferred_mode = handle.mode
 *             except AttributeError:             # <<<<<<<<<<<<<<
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(6, 637, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "pyarrow/io.pxi":640
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
        {
          __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/io.pxi":641
 *                 # (e.g. BytesIO)
 *                 try:
 *                     inferred_mode = 'w' if handle.writable() else 'r'             # <<<<<<<<<<<<<<
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "
 */
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_writable); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 641, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_16 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_16)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_16);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
              }
            }
            __pyx_t_14 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 641, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 641, __pyx_L12_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_2) {
              __Pyx_INCREF(__pyx_n_u_w);
              __pyx_t_13 = __pyx_n_u_w;
            } else {
              __Pyx_INCREF(__pyx_n_u_r);
              __pyx_t_13 = __pyx_n_u_r;
            }
            __Pyx_XDECREF_SET(__pyx_v_inferred_mode, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "pyarrow/io.pxi":640
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
          }
          __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_L19_try_end;
          __pyx_L12_error:;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "pyarrow/io.pxi":642
 *                 try:
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:             # <<<<<<<<<<<<<<
 *                     raise ValueError("could not infer open mode for file-like "
 *                                      "object %r, please pass it explicitly"
 */
          __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
          if (__pyx_t_7) {
            __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(6, 642, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GOTREF(__pyx_t_15);

            /* "pyarrow/io.pxi":643
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "             # <<<<<<<<<<<<<<
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 */
            __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(6, 643, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __Pyx_INCREF(__pyx_kp_u_could_not_infer_open_mode_for_fi);
            __pyx_t_17 += 47;
            __Pyx_GIVEREF(__pyx_kp_u_could_not_infer_open_mode_for_fi);
            PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_kp_u_could_not_infer_open_mode_for_fi);

            /* "pyarrow/io.pxi":645
 *                     raise ValueError("could not infer open mode for file-like "
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))             # <<<<<<<<<<<<<<
 *         else:
 *             inferred_mode = mode
 */
            __pyx_t_19 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_handle), __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 645, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u_please_pass_it_explicitly);
            __pyx_t_17 += 27;
            __Pyx_GIVEREF(__pyx_kp_u_please_pass_it_explicitly);
            PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_kp_u_please_pass_it_explicitly);

            /* "pyarrow/io.pxi":643
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "             # <<<<<<<<<<<<<<
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 */
            __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 643, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_19); if (unlikely(!__pyx_t_16)) __PYX_ERR(6, 643, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_Raise(__pyx_t_16, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __PYX_ERR(6, 643, __pyx_L14_except_error)
          }
          goto __pyx_L14_except_error;
          __pyx_L14_except_error:;

          /* "pyarrow/io.pxi":640
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
          __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_L6_except_error;
          __pyx_L19_try_end:;
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "pyarrow/io.pxi":635
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L9_try_end:;
    }

    /* "pyarrow/io.pxi":634
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 inferred_mode = handle.mode
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":647
 *                                      % (handle,))
 *         else:
 *             inferred_mode = mode             # <<<<<<<<<<<<<<
 * 
 *         if inferred_mode.startswith('w'):
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_mode);
    __pyx_v_inferred_mode = __pyx_v_mode;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":649
 *             inferred_mode = mode
 * 
 *         if inferred_mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_inferred_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_n_u_w) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_w);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":650
 * 
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'             # <<<<<<<<<<<<<<
 *         elif inferred_mode.startswith('r'):
 *             kind = 'r'
 */
    __Pyx_INCREF(__pyx_n_u_w);
    __pyx_v_kind = __pyx_n_u_w;

    /* "pyarrow/io.pxi":649
 *             inferred_mode = mode
 * 
 *         if inferred_mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":651
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             kind = 'r'
 *         else:
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_inferred_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_n_u_r) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_r);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":652
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 *             kind = 'r'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __Pyx_INCREF(__pyx_n_u_r);
    __pyx_v_kind = __pyx_n_u_r;

    /* "pyarrow/io.pxi":651
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             kind = 'r'
 *         else:
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":654
 *             kind = 'r'
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         # If mode was given, check it matches the given file
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_mode);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(6, 654, __pyx_L1_error)
  }
  __pyx_L22:;

  /* "pyarrow/io.pxi":657
 * 
 *         # If mode was given, check it matches the given file
 *         if mode is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 */
  __pyx_t_2 = (__pyx_v_mode != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":658
 *         # If mode was given, check it matches the given file
 *         if mode is not None:
 *             if isinstance(handle, IOBase):             # <<<<<<<<<<<<<<
 *                 # Python 3 IO object
 *                 if kind == 'r':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 658, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/io.pxi":660
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")
 */
      __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 660, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "pyarrow/io.pxi":661
 *                 # Python 3 IO object
 *                 if kind == 'r':
 *                     if not handle.readable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_readable); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 661, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_2 = ((!__pyx_t_1) != 0);
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":662
 *                 if kind == 'r':
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if not handle.writable():
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__190, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 662, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(6, 662, __pyx_L1_error)

          /* "pyarrow/io.pxi":661
 *                 # Python 3 IO object
 *                 if kind == 'r':
 *                     if not handle.readable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        }

        /* "pyarrow/io.pxi":660
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")
 */
        goto __pyx_L25;
      }

      /* "pyarrow/io.pxi":664
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if not handle.writable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):
 */
      /*else*/ {
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_writable); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 664, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 664, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 664, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = ((!__pyx_t_2) != 0);
        if (unlikely(__pyx_t_1)) {

          /* "pyarrow/io.pxi":665
 *                 else:
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 665, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(6, 665, __pyx_L1_error)

          /* "pyarrow/io.pxi":664
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if not handle.writable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):
 */
        }
      }
      __pyx_L25:;

      /* "pyarrow/io.pxi":658
 *         # If mode was given, check it matches the given file
 *         if mode is not None:
 *             if isinstance(handle, IOBase):             # <<<<<<<<<<<<<<
 *                 # Python 3 IO object
 *                 if kind == 'r':
 */
      goto __pyx_L24;
    }

    /* "pyarrow/io.pxi":666
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):             # <<<<<<<<<<<<<<
 *                 # Python 2 file type
 *                 if kind == 'r':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_file_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = (__pyx_t_8 != Py_None);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_20 = (__pyx_t_2 != 0);
    if (__pyx_t_20) {
    } else {
      __pyx_t_1 = __pyx_t_20;
      goto __pyx_L28_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_file_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_20 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(6, 666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_t_20 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L28_bool_binop_done:;
    if (__pyx_t_1) {

      /* "pyarrow/io.pxi":668
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")
 */
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 668, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/io.pxi":669
 *                 # Python 2 file type
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 669, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_r, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 669, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_20 = (__pyx_t_1 != 0);
        if (__pyx_t_20) {
        } else {
          __pyx_t_2 = __pyx_t_20;
          goto __pyx_L32_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 669, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__27, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_20 < 0)) __PYX_ERR(6, 669, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = (__pyx_t_20 != 0);
        __pyx_t_2 = __pyx_t_1;
        __pyx_L32_bool_binop_done:;
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":670
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__190, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 670, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(6, 670, __pyx_L1_error)

          /* "pyarrow/io.pxi":669
 *                 # Python 2 file type
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        }

        /* "pyarrow/io.pxi":668
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")
 */
        goto __pyx_L30;
      }

      /* "pyarrow/io.pxi":672
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             # (other duck-typed file-like objects are possible)
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 672, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_w, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 672, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_20 = (__pyx_t_1 != 0);
        if (__pyx_t_20) {
        } else {
          __pyx_t_2 = __pyx_t_20;
          goto __pyx_L35_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 672, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__27, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_20 < 0)) __PYX_ERR(6, 672, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = (__pyx_t_20 != 0);
        __pyx_t_2 = __pyx_t_1;
        __pyx_L35_bool_binop_done:;
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":673
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             # (other duck-typed file-like objects are possible)
 * 
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 673, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(6, 673, __pyx_L1_error)

          /* "pyarrow/io.pxi":672
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             # (other duck-typed file-like objects are possible)
 */
        }
      }
      __pyx_L30:;

      /* "pyarrow/io.pxi":666
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):             # <<<<<<<<<<<<<<
 *                 # Python 2 file type
 *                 if kind == 'r':
 */
    }
    __pyx_L24:;

    /* "pyarrow/io.pxi":657
 * 
 *         # If mode was given, check it matches the given file
 *         if mode is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 */
  }

  /* "pyarrow/io.pxi":677
 * 
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):             # <<<<<<<<<<<<<<
 *             raise TypeError("binary file expected, got text file")
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_TextIOBase); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":678
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):
 *             raise TypeError("binary file expected, got text file")             # <<<<<<<<<<<<<<
 * 
 *         if kind == 'r':
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(6, 678, __pyx_L1_error)

    /* "pyarrow/io.pxi":677
 * 
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):             # <<<<<<<<<<<<<<
 *             raise TypeError("binary file expected, got text file")
 * 
 */
  }

  /* "pyarrow/io.pxi":680
 *             raise TypeError("binary file expected, got text file")
 * 
 *         if kind == 'r':             # <<<<<<<<<<<<<<
 *             self.set_random_access_file(
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 680, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":681
 * 
 *         if kind == 'r':
 *             self.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 *             self.is_readable = True
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr<arrow::io::RandomAccessFile> (new arrow::py::PyReadableFile(__pyx_v_handle))); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":683
 *             self.set_random_access_file(
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_output_stream(
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":680
 *             raise TypeError("binary file expected, got text file")
 * 
 *         if kind == 'r':             # <<<<<<<<<<<<<<
 *             self.set_random_access_file(
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 */
    goto __pyx_L38;
  }

  /* "pyarrow/io.pxi":685
 *             self.is_readable = True
 *         else:
 *             self.set_output_stream(             # <<<<<<<<<<<<<<
 *                 shared_ptr[OutputStream](new PyOutputStream(handle)))
 *             self.is_writable = True
 */
  /*else*/ {

    /* "pyarrow/io.pxi":686
 *         else:
 *             self.set_output_stream(
 *                 shared_ptr[OutputStream](new PyOutputStream(handle)))             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 * 
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr<arrow::io::OutputStream> (new arrow::py::PyOutputStream(__pyx_v_handle))); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":687
 *             self.set_output_stream(
 *                 shared_ptr[OutputStream](new PyOutputStream(handle)))
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self, pos=None):
 */
    __pyx_v_self->__pyx_base.is_writable = 1;
  }
  __pyx_L38:;

  /* "pyarrow/io.pxi":631
 *         object handle
 * 
 *     def __cinit__(self, handle, mode=None):             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inferred_mode);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":689
 *             self.is_writable = True
 * 
 *     def truncate(self, pos=None):             # <<<<<<<<<<<<<<
 *         self.handle.truncate(pos)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_2truncate[] = "PythonFile.truncate(self, pos=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(6, 689, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 689, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_2truncate(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_pos);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_2truncate(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_pos) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);

  /* "pyarrow/io.pxi":690
 * 
 *     def truncate(self, pos=None):
 *         self.handle.truncate(pos)             # <<<<<<<<<<<<<<
 * 
 *     def readline(self, size=None):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->handle, __pyx_n_s_truncate); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_pos) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pos);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":689
 *             self.is_writable = True
 * 
 *     def truncate(self, pos=None):             # <<<<<<<<<<<<<<
 *         self.handle.truncate(pos)
 * 
 */

  /* 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.lib.PythonFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":692
 *         self.handle.truncate(pos)
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readline(size)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_5readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_4readline[] = "PythonFile.readline(self, size=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_5readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readline (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readline") < 0)) __PYX_ERR(6, 692, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readline", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 692, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_4readline(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_4readline(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readline", 0);

  /* "pyarrow/io.pxi":693
 * 
 *     def readline(self, size=None):
 *         return self.handle.readline(size)             # <<<<<<<<<<<<<<
 * 
 *     def readlines(self, hint=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_size);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 693, __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/io.pxi":692
 *         self.handle.truncate(pos)
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readline(size)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":695
 *         return self.handle.readline(size)
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readlines(hint)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_7readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_6readlines[] = "PythonFile.readlines(self, hint=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_7readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_hint = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readlines (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readlines") < 0)) __PYX_ERR(6, 695, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readlines", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 695, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_6readlines(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_hint);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_6readlines(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_hint) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readlines", 0);

  /* "pyarrow/io.pxi":696
 * 
 *     def readlines(self, hint=None):
 *         return self.handle.readlines(hint)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->handle, __pyx_n_s_readlines); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_hint) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_hint);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 696, __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/io.pxi":695
 *         return self.handle.readline(size)
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readlines(hint)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_8__reduce_cython__[] = "PythonFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_10__setstate_cython__[] = "PythonFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":710
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_create[] = "MemoryMappedFile.create(path, size)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_16MemoryMappedFile_1create = {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_create};
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 1, 2, 2, 1); __PYX_ERR(6, 710, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(6, 710, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 710, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_create(__pyx_v_path, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_create(PyObject *__pyx_v_path, PyObject *__pyx_v_size) {
  std::shared_ptr< arrow::io::MemoryMappedFile>  __pyx_v_handle;
  std::string __pyx_v_c_path;
  int64_t __pyx_v_c_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__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;
  std::string __pyx_t_4;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("create", 0);

  /* "pyarrow/io.pxi":713
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 *             c_string c_path = encode_file_path(path)             # <<<<<<<<<<<<<<
 *             int64_t c_size = size
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":714
 *             shared_ptr[CMemoryMappedFile] handle
 *             c_string c_path = encode_file_path(path)
 *             int64_t c_size = size             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_size); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 714, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_5;

  /* "pyarrow/io.pxi":716
 *             int64_t c_size = size
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":717
 * 
 *         with nogil:
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))             # <<<<<<<<<<<<<<
 * 
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::MemoryMappedFile::Create(__pyx_v_c_path, __pyx_v_c_size, (&__pyx_v_handle))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 717, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":716
 *             int64_t c_size = size
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":719
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))
 * 
 *         cdef MemoryMappedFile result = MemoryMappedFile()             # <<<<<<<<<<<<<<
 *         result.path = path
 *         result.is_readable = True
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":720
 * 
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 *         result.path = path             # <<<<<<<<<<<<<<
 *         result.is_readable = True
 *         result.is_writable = True
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(__pyx_v_result->path);
  __Pyx_DECREF(__pyx_v_result->path);
  __pyx_v_result->path = __pyx_v_path;

  /* "pyarrow/io.pxi":721
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 *         result.path = path
 *         result.is_readable = True             # <<<<<<<<<<<<<<
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 */
  __pyx_v_result->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":722
 *         result.path = path
 *         result.is_readable = True
 *         result.is_writable = True             # <<<<<<<<<<<<<<
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 */
  __pyx_v_result->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":723
 *         result.is_readable = True
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)             # <<<<<<<<<<<<<<
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         result.handle = handle
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_result), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":724
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 *         result.handle = handle
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_result), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":725
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         result.handle = handle             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_v_result->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":727
 *         result.handle = handle
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, path, mode='r'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":710
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":729
 *         return result
 * 
 *     def _open(self, path, mode='r'):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_2_open[] = "MemoryMappedFile._open(self, path, mode=u'r')";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(6, 729, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 729, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_2_open(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self), __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_2_open(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode) {
  enum  arrow::io::FileMode::type __pyx_v_c_mode;
  std::shared_ptr< arrow::io::MemoryMappedFile>  __pyx_v_handle;
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/io.pxi":730
 * 
 *     def _open(self, path, mode='r'):
 *         self.path = path             # <<<<<<<<<<<<<<
 * 
 *         cdef:
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = __pyx_v_path;

  /* "pyarrow/io.pxi":735
 *             FileMode c_mode
 *             shared_ptr[CMemoryMappedFile] handle
 *             c_string c_path = encode_file_path(path)             # <<<<<<<<<<<<<<
 * 
 *         if mode in ('r', 'rb'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":737
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 737, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 737, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":738
 * 
 *         if mode in ('r', 'rb'):
 *             c_mode = FileMode_READ             # <<<<<<<<<<<<<<
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):
 */
    __pyx_v_c_mode =  arrow::io::FileMode::READ;

    /* "pyarrow/io.pxi":739
 *         if mode in ('r', 'rb'):
 *             c_mode = FileMode_READ
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *         elif mode in ('w', 'wb'):
 *             c_mode = FileMode_WRITE
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":737
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":740
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 740, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 740, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":741
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):
 *             c_mode = FileMode_WRITE             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):
 */
    __pyx_v_c_mode =  arrow::io::FileMode::WRITE;

    /* "pyarrow/io.pxi":742
 *         elif mode in ('w', 'wb'):
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 *         elif mode in ('r+', 'r+b', 'rb+'):
 *             c_mode = FileMode_READWRITE
 */
    __pyx_v_self->__pyx_base.is_writable = 1;

    /* "pyarrow/io.pxi":740
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":743
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_r_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 743, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_r_b, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 743, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_rb, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 743, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L8_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (likely(__pyx_t_6)) {

    /* "pyarrow/io.pxi":744
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):
 *             c_mode = FileMode_READWRITE             # <<<<<<<<<<<<<<
 *             self.is_readable = True
 *             self.is_writable = True
 */
    __pyx_v_c_mode =  arrow::io::FileMode::READWRITE;

    /* "pyarrow/io.pxi":745
 *         elif mode in ('r+', 'r+b', 'rb+'):
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 *         else:
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":746
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __pyx_v_self->__pyx_base.is_writable = 1;

    /* "pyarrow/io.pxi":743
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":748
 *             self.is_writable = True
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_mode);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(6, 748, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":750
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":751
 * 
 *         with nogil:
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> handle)
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::MemoryMappedFile::Open(__pyx_v_c_path, __pyx_v_c_mode, (&__pyx_v_handle))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 751, __pyx_L12_error)
      }

      /* "pyarrow/io.pxi":750
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L13;
        }
        __pyx_L12_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L13:;
      }
  }

  /* "pyarrow/io.pxi":753
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> handle)             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         self.handle = handle
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":754
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":755
 *         self.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         self.handle = handle             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, new_size):
 */
  __pyx_v_self->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":729
 *         return result
 * 
 *     def _open(self, path, mode='r'):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

  /* 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.lib.MemoryMappedFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":757
 *         self.handle = handle
 * 
 *     def resize(self, new_size):             # <<<<<<<<<<<<<<
 *         """
 *         Resize the map and underlying file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize(PyObject *__pyx_v_self, PyObject *__pyx_v_new_size); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_4resize[] = "MemoryMappedFile.resize(self, new_size)\n\n        Resize the map and underlying file.\n\n        Parameters\n        ----------\n        new_size : new size in bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize(PyObject *__pyx_v_self, PyObject *__pyx_v_new_size) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self), ((PyObject *)__pyx_v_new_size));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_new_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("resize", 0);

  /* "pyarrow/io.pxi":765
 *         new_size : new size in bytes
 *         """
 *         check_status(self.handle.get().Resize(new_size))             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_new_size); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 765, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->handle.get()->Resize(__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 765, __pyx_L1_error)

  /* "pyarrow/io.pxi":757
 *         self.handle = handle
 * 
 *     def resize(self, new_size):             # <<<<<<<<<<<<<<
 *         """
 *         Resize the map and underlying file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":767
 *         check_status(self.handle.get().Resize(new_size))
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.get().file_descriptor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_7fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_6fileno[] = "MemoryMappedFile.fileno(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_7fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_6fileno(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_6fileno(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fileno", 0);

  /* "pyarrow/io.pxi":768
 * 
 *     def fileno(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.handle.get().file_descriptor()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":769
 *     def fileno(self):
 *         self._assert_open()
 *         return self.handle.get().file_descriptor()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->handle.get()->file_descriptor()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":767
 *         check_status(self.handle.get().Resize(new_size))
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.get().file_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.lib.MemoryMappedFile.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__[] = "MemoryMappedFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__[] = "MemoryMappedFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":772
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_151memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_150memory_map[] = "memory_map(path, mode=u'r')\n\n    Open memory map at file path. Size of the memory map cannot change\n\n    Parameters\n    ----------\n    path : string\n    mode : {'r', 'r+', 'w'}, default 'r'\n        Whether the file is opened for reading ('r+'), writing ('w')\n        or both ('r+').\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_151memory_map = {"memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_151memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_150memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_151memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("memory_map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "memory_map") < 0)) __PYX_ERR(6, 772, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("memory_map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 772, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_150memory_map(__pyx_self, __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_150memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_mmap = 0;
  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 = NULL;
  __Pyx_RefNannySetupContext("memory_map", 0);

  /* "pyarrow/io.pxi":787
 *     mmap : MemoryMappedFile
 *     """
 *     cdef MemoryMappedFile mmap = MemoryMappedFile()             # <<<<<<<<<<<<<<
 *     mmap._open(path, mode)
 *     return mmap
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_mmap = ((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":788
 *     """
 *     cdef MemoryMappedFile mmap = MemoryMappedFile()
 *     mmap._open(path, mode)             # <<<<<<<<<<<<<<
 *     return mmap
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mmap), __pyx_n_s_open_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_mode};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 788, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_mode};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 788, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_mode);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":789
 *     cdef MemoryMappedFile mmap = MemoryMappedFile()
 *     mmap._open(path, mode)
 *     return mmap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_mmap));
  __pyx_r = ((PyObject *)__pyx_v_mmap);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":772
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */

  /* 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.lib.memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mmap);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":792
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_153create_memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_152create_memory_map[] = "create_memory_map(path, size)\n\n    Create a file of the given size and memory-map it.\n\n    Parameters\n    ----------\n    path : string\n        The file path to create, on the local filesystem.\n    size : int\n        The file size to create.\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_153create_memory_map = {"create_memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_153create_memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_152create_memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_153create_memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_memory_map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_memory_map", 1, 2, 2, 1); __PYX_ERR(6, 792, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_memory_map") < 0)) __PYX_ERR(6, 792, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_memory_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 792, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.create_memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_152create_memory_map(__pyx_self, __pyx_v_path, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_152create_memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_size) {
  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 = NULL;
  __Pyx_RefNannySetupContext("create_memory_map", 0);

  /* "pyarrow/io.pxi":807
 *     mmap : MemoryMappedFile
 *     """
 *     return MemoryMappedFile.create(path, size)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile), __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_size};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 807, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_size};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 807, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_size);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":792
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */

  /* 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.lib.create_memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":817
 *         object path
 * 
 *     def __cinit__(self, path, mode='r', MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 817, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 817, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.OSFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 817, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6OSFile___cinit__(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::string __pyx_v_c_path;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":818
 * 
 *     def __cinit__(self, path, mode='r', MemoryPool memory_pool=None):
 *         self.path = path             # <<<<<<<<<<<<<<
 * 
 *         cdef:
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = __pyx_v_path;

  /* "pyarrow/io.pxi":823
 *             FileMode c_mode
 *             shared_ptr[Readable] handle
 *             c_string c_path = encode_file_path(path)             # <<<<<<<<<<<<<<
 * 
 *         if mode in ('r', 'rb'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 823, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":825
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 825, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 825, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":826
 * 
 *         if mode in ('r', 'rb'):
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))             # <<<<<<<<<<<<<<
 *         elif mode in ('w', 'wb'):
 *             self._open_writable(c_path)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->_open_readable(__pyx_v_self, __pyx_v_c_path, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":825
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":827
 *         if mode in ('r', 'rb'):
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             self._open_writable(c_path)
 *         else:
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 827, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 827, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (likely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":828
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):
 *             self._open_writable(c_path)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->_open_writable(__pyx_v_self, __pyx_v_c_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":827
 *         if mode in ('r', 'rb'):
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             self._open_writable(c_path)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":830
 *             self._open_writable(c_path)
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_mode);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(6, 830, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":817
 *         object path
 * 
 *     def __cinit__(self, path, mode='r', MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

  /* 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.lib.OSFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":832
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[ReadableFile] handle
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_readable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path,  arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr<arrow::io::ReadableFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_open_readable", 0);

  /* "pyarrow/io.pxi":835
 *         cdef shared_ptr[ReadableFile] handle
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ReadableFile.Open(path, pool, &handle))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":836
 * 
 *         with nogil:
 *             check_status(ReadableFile.Open(path, pool, &handle))             # <<<<<<<<<<<<<<
 * 
 *         self.is_readable = True
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::ReadableFile::Open(__pyx_v_path, __pyx_v_pool, (&__pyx_v_handle))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 836, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":835
 *         cdef shared_ptr[ReadableFile] handle
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ReadableFile.Open(path, pool, &handle))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":838
 *             check_status(ReadableFile.Open(path, pool, &handle))
 * 
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":839
 * 
 *         self.is_readable = True
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_writable(self, c_string path):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":832
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[ReadableFile] handle
 * 
 */

  /* 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.lib.OSFile._open_readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":841
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 */

static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_writable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_open_writable", 0);

  /* "pyarrow/io.pxi":842
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 *         self.is_writable = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":843
 *     cdef _open_writable(self, c_string path):
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::FileOutputStream::Open(__pyx_v_path, (&__pyx_v_self->__pyx_base.output_stream))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 843, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":842
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 *         self.is_writable = True
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":844
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":841
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.OSFile._open_writable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":846
 *         self.is_writable = True
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.file_descriptor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_3fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6OSFile_2fileno[] = "OSFile.fileno(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_3fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile_2fileno(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_2fileno(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fileno", 0);

  /* "pyarrow/io.pxi":847
 * 
 *     def fileno(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.handle.file_descriptor()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":848
 *     def fileno(self):
 *         self._assert_open()
 *         return self.handle.file_descriptor()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_file_descriptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":846
 *         self.is_writable = True
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.file_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.lib.OSFile.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6OSFile_4__reduce_cython__[] = "OSFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.OSFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6OSFile_6__setstate_cython__[] = "OSFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__198, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.OSFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":856
 *     """
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buffer = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 856, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 856, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "buffer", 0))) __PYX_ERR(6, 856, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), __pyx_v_buffer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buffer) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":857
 * 
 *     def __cinit__(self, Buffer buffer):
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::FixedSizeBufferWriter(__pyx_v_buffer->buffer));

  /* "pyarrow/io.pxi":858
 *     def __cinit__(self, Buffer buffer):
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_threads(self, int num_threads):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":856
 *     """
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":860
 *         self.is_writable = True
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads(PyObject *__pyx_v_self, PyObject *__pyx_arg_num_threads); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads[] = "FixedSizeBufferWriter.set_memcopy_threads(self, int num_threads)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads(PyObject *__pyx_v_self, PyObject *__pyx_arg_num_threads) {
  int __pyx_v_num_threads;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threads (wrapper)", 0);
  assert(__pyx_arg_num_threads); {
    __pyx_v_num_threads = __Pyx_PyInt_As_int(__pyx_arg_num_threads); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 860, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.set_memcopy_threads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((int)__pyx_v_num_threads));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int __pyx_v_num_threads) {
   arrow::io::FixedSizeBufferWriter *__pyx_v_writer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threads", 0);

  /* "pyarrow/io.pxi":862
 *     def set_memcopy_threads(self, int num_threads):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threads(num_threads)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":863
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_threads(num_threads)             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):
 */
  __pyx_v_writer->set_memcopy_threads(__pyx_v_num_threads);

  /* "pyarrow/io.pxi":860
 *         self.is_writable = True
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":865
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocksize); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize[] = "FixedSizeBufferWriter.set_memcopy_blocksize(self, int64_t blocksize)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocksize) {
  int64_t __pyx_v_blocksize;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_blocksize (wrapper)", 0);
  assert(__pyx_arg_blocksize); {
    __pyx_v_blocksize = __Pyx_PyInt_As_int64_t(__pyx_arg_blocksize); if (unlikely((__pyx_v_blocksize == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 865, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.set_memcopy_blocksize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((int64_t)__pyx_v_blocksize));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_blocksize) {
   arrow::io::FixedSizeBufferWriter *__pyx_v_writer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_blocksize", 0);

  /* "pyarrow/io.pxi":867
 *     def set_memcopy_blocksize(self, int64_t blocksize):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":868
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_blocksize(blocksize)             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):
 */
  __pyx_v_writer->set_memcopy_blocksize(__pyx_v_blocksize);

  /* "pyarrow/io.pxi":865
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":870
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold(PyObject *__pyx_v_self, PyObject *__pyx_arg_threshold); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold[] = "FixedSizeBufferWriter.set_memcopy_threshold(self, int64_t threshold)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold(PyObject *__pyx_v_self, PyObject *__pyx_arg_threshold) {
  int64_t __pyx_v_threshold;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threshold (wrapper)", 0);
  assert(__pyx_arg_threshold); {
    __pyx_v_threshold = __Pyx_PyInt_As_int64_t(__pyx_arg_threshold); if (unlikely((__pyx_v_threshold == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 870, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.set_memcopy_threshold", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((int64_t)__pyx_v_threshold));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_threshold) {
   arrow::io::FixedSizeBufferWriter *__pyx_v_writer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threshold", 0);

  /* "pyarrow/io.pxi":872
 *     def set_memcopy_threshold(self, int64_t threshold):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threshold(threshold)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":873
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_threshold(threshold)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_writer->set_memcopy_threshold(__pyx_v_threshold);

  /* "pyarrow/io.pxi":870
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* 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):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__[] = "FixedSizeBufferWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__[] = "FixedSizeBufferWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__200, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":888
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer___cinit__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Buffer___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":891
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Buffer's constructor directly, use "
 *                         "`pyarrow.py_buffer` function instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Buffer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Buffer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_2__init__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Buffer_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":892
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Buffer's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 892, __pyx_L1_error)

  /* "pyarrow/io.pxi":891
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Buffer's constructor directly, use "
 *                         "`pyarrow.py_buffer` function instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":895
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.buffer = buffer
 *         self.shape[0] = self.size
 */

static void __pyx_f_7pyarrow_3lib_6Buffer_init(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, std::shared_ptr< arrow::Buffer>  const &__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/io.pxi":896
 * 
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):
 *         self.buffer = buffer             # <<<<<<<<<<<<<<
 *         self.shape[0] = self.size
 *         self.strides[0] = <Py_ssize_t>(1)
 */
  __pyx_v_self->buffer = __pyx_v_buffer;

  /* "pyarrow/io.pxi":897
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):
 *         self.buffer = buffer
 *         self.shape[0] = self.size             # <<<<<<<<<<<<<<
 *         self.strides[0] = <Py_ssize_t>(1)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_self->shape[0]) = __pyx_t_2;

  /* "pyarrow/io.pxi":898
 *         self.buffer = buffer
 *         self.shape[0] = self.size
 *         self.strides[0] = <Py_ssize_t>(1)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  (__pyx_v_self->strides[0]) = ((Py_ssize_t)1);

  /* "pyarrow/io.pxi":895
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.buffer = buffer
 *         self.shape[0] = self.size
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.Buffer.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":900
 *         self.strides[0] = <Py_ssize_t>(1)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_5__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_4__len__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_4__len__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/io.pxi":901
 * 
 *     def __len__(self):
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 901, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":900
 *         self.strides[0] = <Py_ssize_t>(1)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":904
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer size in bytes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":908
 *         The buffer size in bytes.
 *         """
 *         return self.buffer.get().size()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->buffer.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":904
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer size in bytes.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":911
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer's address, as an integer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":915
 *         The buffer's address, as an integer.
 *         """
 *         return <uintptr_t> self.buffer.get().data()             # <<<<<<<<<<<<<<
 * 
 *     def hex(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((uintptr_t)__pyx_v_self->buffer.get()->data())); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":911
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer's address, as an integer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":917
 *         return <uintptr_t> self.buffer.get().data()
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute hexadecimal representation of the buffer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_6hex[] = "Buffer.hex(self)\n\n        Compute hexadecimal representation of the buffer.\n\n        Returns\n        -------\n        : bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hex (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_6hex(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6hex(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("hex", 0);

  /* "pyarrow/io.pxi":925
 *         : bytes
 *         """
 *         return self.buffer.get().ToHexString()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->buffer.get()->ToHexString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":917
 *         return <uintptr_t> self.buffer.get().data()
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute hexadecimal representation of the buffer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":928
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the buffer is mutable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":932
 *         Whether the buffer is mutable.
 *         """
 *         return self.buffer.get().is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->buffer.get()->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":928
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the buffer is mutable.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":935
 * 
 *     @property
 *     def parent(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_6parent_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_6parent_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_6parent___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6parent___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_parent_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":936
 *     @property
 *     def parent(self):
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()             # <<<<<<<<<<<<<<
 * 
 *         if parent_buf.get() == NULL:
 */
  __pyx_v_parent_buf = __pyx_v_self->buffer.get()->parent();

  /* "pyarrow/io.pxi":938
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 *         if parent_buf.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_parent_buf.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":939
 * 
 *         if parent_buf.get() == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_buffer(parent_buf)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/io.pxi":938
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 *         if parent_buf.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "pyarrow/io.pxi":941
 *             return None
 *         else:
 *             return pyarrow_wrap_buffer(parent_buf)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_parent_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":935
 * 
 *     @property
 *     def parent(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.parent.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":943
 *             return pyarrow_wrap_buffer(parent_buf)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_8__getitem__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_8__getitem__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_key) {
  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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/io.pxi":944
 * 
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 * 
 */
  __pyx_t_1 = (PySlice_Check(__pyx_v_key) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":945
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 * 
 *         return self.getitem(_normalize_index(key, self.size))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 945, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 945, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_key);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":944
 * 
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 * 
 */
  }

  /* "pyarrow/io.pxi":947
 *             return _normalize_slice(self, key)
 * 
 *         return self.getitem(_normalize_index(key, self.size))             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 947, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 947, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *)__pyx_v_self->__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":943
 *             return pyarrow_wrap_buffer(parent_buf)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)
 */

  /* 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_6);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":949
 *         return self.getitem(_normalize_index(key, self.size))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().data()[i]
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_6Buffer_getitem(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, int64_t __pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/io.pxi":950
 * 
 *     cdef getitem(self, int64_t i):
 *         return self.buffer.get().data()[i]             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_self->buffer.get()->data()[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":949
 *         return self.getitem(_normalize_index(key, self.size))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().data()[i]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":952
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Slice this buffer.  Memory is not copied.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_11slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_10slice[] = "Buffer.slice(self, offset=0, length=None)\n\n        Slice this buffer.  Memory is not copied.\n\n        You can also use the Python slice notation ``buffer[start:stop]``.\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of buffer to slice\n        length : int, default None\n            Length of slice (default is until end of Buffer starting from\n            offset)\n\n        Returns\n        -------\n        sliced : Buffer\n            A logical view over this buffer.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_11slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(6, 952, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 952, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Buffer.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_10slice(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10slice(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int64_t __pyx_t_9;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/io.pxi":973
 *         cdef shared_ptr[CBuffer] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 973, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":974
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 974, __pyx_L1_error)

    /* "pyarrow/io.pxi":973
 *         cdef shared_ptr[CBuffer] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/io.pxi":976
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":977
 * 
 *         if length is None:
 *             result = SliceBuffer(self.buffer, offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = SliceBuffer(self.buffer, offset, max(length, 0))
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 977, __pyx_L1_error)
    __pyx_v_result = arrow::SliceBuffer(__pyx_v_self->buffer, __pyx_t_4);

    /* "pyarrow/io.pxi":976
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/io.pxi":979
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 *             result = SliceBuffer(self.buffer, offset, max(length, 0))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_buffer(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 979, __pyx_L1_error)
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_v_length);
    __pyx_t_1 = __pyx_v_length;
    __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 979, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 979, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_3) {
      __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 979, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = __pyx_t_8;
      __pyx_t_8 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 979, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_result = arrow::SliceBuffer(__pyx_v_self->buffer, __pyx_t_4, __pyx_t_9);
  }
  __pyx_L4:;

  /* "pyarrow/io.pxi":981
 *             result = SliceBuffer(self.buffer, offset, max(length, 0))
 * 
 *         return pyarrow_wrap_buffer(result)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Buffer other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":952
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Slice this buffer.  Memory is not copied.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":983
 *         return pyarrow_wrap_buffer(result)
 * 
 *     def equals(self, Buffer other):             # <<<<<<<<<<<<<<
 *         """
 *         Determine if two buffers contain exactly the same data.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_12equals[] = "Buffer.equals(self, Buffer other)\n\n        Determine if two buffers contain exactly the same data.\n\n        Parameters\n        ----------\n        other : Buffer\n\n        Returns\n        -------\n        are_equal : True if buffer contents and size are equal\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "other", 0))) __PYX_ERR(6, 983, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_12equals(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_12equals(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_other) {
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/io.pxi":995
 *         are_equal : True if buffer contents and size are equal
 *         """
 *         cdef c_bool result = False             # <<<<<<<<<<<<<<
 *         with nogil:
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 */
  __pyx_v_result = 0;

  /* "pyarrow/io.pxi":996
 *         """
 *         cdef c_bool result = False
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 *         return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":997
 *         cdef c_bool result = False
 *         with nogil:
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        __pyx_v_result = __pyx_v_self->buffer.get()->Equals((*__pyx_v_other->buffer.get()));
      }

      /* "pyarrow/io.pxi":996
 *         """
 *         cdef c_bool result = False
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 *         return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":998
 *         with nogil:
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":983
 *         return pyarrow_wrap_buffer(result)
 * 
 *     def equals(self, Buffer other):             # <<<<<<<<<<<<<<
 *         """
 *         Determine if two buffers contain exactly the same data.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1000
 *         return result
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Buffer):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_14__eq__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_14__eq__(struct __pyx_obj_7pyarrow_3lib_Buffer *__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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/io.pxi":1001
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1002
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1001
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":1004
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __reduce_ex__(self, protocol):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1000
 *         return result
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Buffer):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1006
 *             return NotImplemented
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         if protocol >= 5:
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_17__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_16__reduce_ex__[] = "Buffer.__reduce_ex__(self, protocol)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_17__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_ex__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_16__reduce_ex__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((PyObject *)__pyx_v_protocol));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_16__reduce_ex__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce_ex__", 0);

  /* "pyarrow/io.pxi":1007
 * 
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:             # <<<<<<<<<<<<<<
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol, __pyx_int_5, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1007, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1008
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)             # <<<<<<<<<<<<<<
 *         else:
 *             return py_buffer, (self.to_pybytes(),)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PickleBuffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1007
 * 
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:             # <<<<<<<<<<<<<<
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":1010
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 *             return py_buffer, (self.to_pybytes(),)             # <<<<<<<<<<<<<<
 * 
 *     def to_pybytes(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pybytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1006
 *             return NotImplemented
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         if protocol >= 5:
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__reduce_ex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1012
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this buffer as a Python bytes object.  Memory is copied.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_19to_pybytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_18to_pybytes[] = "Buffer.to_pybytes(self)\n\n        Return this buffer as a Python bytes object.  Memory is copied.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_19to_pybytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pybytes (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_18to_pybytes(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_18to_pybytes(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("to_pybytes", 0);

  /* "pyarrow/io.pxi":1016
 *         Return this buffer as a Python bytes object.  Memory is copied.
 *         """
 *         return cp.PyBytes_FromStringAndSize(             # <<<<<<<<<<<<<<
 *             <const char*>self.buffer.get().data(),
 *             self.buffer.get().size())
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io.pxi":1018
 *         return cp.PyBytes_FromStringAndSize(
 *             <const char*>self.buffer.get().data(),
 *             self.buffer.get().size())             # <<<<<<<<<<<<<<
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 */
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_self->buffer.get()->data()), __pyx_v_self->buffer.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1012
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this buffer as a Python bytes object.  Memory is copied.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.to_pybytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1020
 *             self.buffer.get().size())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         if self.buffer.get().is_mutable():
 *             buffer.readonly = 0
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Buffer_21__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Buffer_21__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_20__getbuffer__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Buffer_20__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  if (__pyx_v_buffer == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "pyarrow/io.pxi":1021
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         if self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->buffer.get()->is_mutable() != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1022
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         if self.buffer.get().is_mutable():
 *             buffer.readonly = 0             # <<<<<<<<<<<<<<
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 */
    __pyx_v_buffer->readonly = 0;

    /* "pyarrow/io.pxi":1021
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         if self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":1024
 *             buffer.readonly = 0
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/io.pxi":1025
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 *                 raise BufferError("Writable buffer requested but Arrow "             # <<<<<<<<<<<<<<
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_BufferError, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1025, __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(6, 1025, __pyx_L1_error)

      /* "pyarrow/io.pxi":1024
 *             buffer.readonly = 0
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 */
    }

    /* "pyarrow/io.pxi":1027
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         buffer.buf = <char *>self.buffer.get().data()
 *         buffer.format = 'b'
 */
    __pyx_v_buffer->readonly = 1;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":1028
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 *         buffer.buf = <char *>self.buffer.get().data()             # <<<<<<<<<<<<<<
 *         buffer.format = 'b'
 *         buffer.internal = NULL
 */
  __pyx_v_buffer->buf = ((char *)__pyx_v_self->buffer.get()->data());

  /* "pyarrow/io.pxi":1029
 *             buffer.readonly = 1
 *         buffer.buf = <char *>self.buffer.get().data()
 *         buffer.format = 'b'             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 *         buffer.itemsize = 1
 */
  __pyx_v_buffer->format = ((char *)"b");

  /* "pyarrow/io.pxi":1030
 *         buffer.buf = <char *>self.buffer.get().data()
 *         buffer.format = 'b'
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 *         buffer.itemsize = 1
 *         buffer.len = self.size
 */
  __pyx_v_buffer->internal = NULL;

  /* "pyarrow/io.pxi":1031
 *         buffer.format = 'b'
 *         buffer.internal = NULL
 *         buffer.itemsize = 1             # <<<<<<<<<<<<<<
 *         buffer.len = self.size
 *         buffer.ndim = 1
 */
  __pyx_v_buffer->itemsize = 1;

  /* "pyarrow/io.pxi":1032
 *         buffer.internal = NULL
 *         buffer.itemsize = 1
 *         buffer.len = self.size             # <<<<<<<<<<<<<<
 *         buffer.ndim = 1
 *         buffer.obj = self
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 1032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buffer->len = __pyx_t_3;

  /* "pyarrow/io.pxi":1033
 *         buffer.itemsize = 1
 *         buffer.len = self.size
 *         buffer.ndim = 1             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         buffer.shape = self.shape
 */
  __pyx_v_buffer->ndim = 1;

  /* "pyarrow/io.pxi":1034
 *         buffer.len = self.size
 *         buffer.ndim = 1
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         buffer.shape = self.shape
 *         buffer.strides = self.strides
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "pyarrow/io.pxi":1035
 *         buffer.ndim = 1
 *         buffer.obj = self
 *         buffer.shape = self.shape             # <<<<<<<<<<<<<<
 *         buffer.strides = self.strides
 *         buffer.suboffsets = NULL
 */
  __pyx_t_4 = __pyx_v_self->shape;
  __pyx_v_buffer->shape = __pyx_t_4;

  /* "pyarrow/io.pxi":1036
 *         buffer.obj = self
 *         buffer.shape = self.shape
 *         buffer.strides = self.strides             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 * 
 */
  __pyx_t_4 = __pyx_v_self->strides;
  __pyx_v_buffer->strides = __pyx_t_4;

  /* "pyarrow/io.pxi":1037
 *         buffer.shape = self.shape
 *         buffer.strides = self.strides
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 */
  __pyx_v_buffer->suboffsets = NULL;

  /* "pyarrow/io.pxi":1020
 *             self.buffer.get().size())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         if self.buffer.get().is_mutable():
 *             buffer.readonly = 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_buffer->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1039
 *         buffer.suboffsets = NULL
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):             # <<<<<<<<<<<<<<
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_23__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_len_out); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_23__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_len_out) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_22__getsegcount__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_len_out));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_22__getsegcount__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t *__pyx_v_len_out) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__getsegcount__", 0);

  /* "pyarrow/io.pxi":1040
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 *         if len_out != NULL:             # <<<<<<<<<<<<<<
 *             len_out[0] = <Py_ssize_t>self.size
 *         return 1
 */
  __pyx_t_1 = ((__pyx_v_len_out != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1041
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 1041, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (__pyx_v_len_out[0]) = ((Py_ssize_t)__pyx_t_3);

    /* "pyarrow/io.pxi":1040
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 *         if len_out != NULL:             # <<<<<<<<<<<<<<
 *             len_out[0] = <Py_ssize_t>self.size
 *         return 1
 */
  }

  /* "pyarrow/io.pxi":1042
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1039
 *         buffer.suboffsets = NULL
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):             # <<<<<<<<<<<<<<
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

/* "pyarrow/io.pxi":1044
 *         return 1
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_25__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_25__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_24__getreadbuffer__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_24__getreadbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__getreadbuffer__", 0);

  /* "pyarrow/io.pxi":1045
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  __pyx_t_1 = ((__pyx_v_idx != 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1046
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")             # <<<<<<<<<<<<<<
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1046, __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(6, 1046, __pyx_L1_error)

    /* "pyarrow/io.pxi":1045
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  }

  /* "pyarrow/io.pxi":1047
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  __pyx_t_1 = ((__pyx_v_p != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1048
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */
    (__pyx_v_p[0]) = ((void *)__pyx_v_self->buffer.get()->data());

    /* "pyarrow/io.pxi":1047
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  }

  /* "pyarrow/io.pxi":1049
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 1049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1044
 *         return 1
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

/* "pyarrow/io.pxi":1051
 *         return self.size
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_27__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_27__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getwritebuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_26__getwritebuffer__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_26__getwritebuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__getwritebuffer__", 0);

  /* "pyarrow/io.pxi":1052
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:
 */
  __pyx_t_1 = ((!(__pyx_v_self->buffer.get()->is_mutable() != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1053
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1053, __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(6, 1053, __pyx_L1_error)

    /* "pyarrow/io.pxi":1052
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:
 */
  }

  /* "pyarrow/io.pxi":1054
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  __pyx_t_1 = ((__pyx_v_idx != 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1055
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")             # <<<<<<<<<<<<<<
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1055, __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(6, 1055, __pyx_L1_error)

    /* "pyarrow/io.pxi":1054
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  }

  /* "pyarrow/io.pxi":1056
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  __pyx_t_1 = ((__pyx_v_p != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1057
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */
    (__pyx_v_p[0]) = ((void *)__pyx_v_self->buffer.get()->data());

    /* "pyarrow/io.pxi":1056
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  }

  /* "pyarrow/io.pxi":1058
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 1058, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1051
 *         return self.size
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getwritebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

/* "pyarrow/io.pxi":1066
 *     """
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 */

static void __pyx_f_7pyarrow_3lib_15ResizableBuffer_init_rz(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, std::shared_ptr< arrow::ResizableBuffer>  const &__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_rz", 0);

  /* "pyarrow/io.pxi":1067
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):
 *         self.init(<shared_ptr[CBuffer]> buffer)             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, int64_t new_size, shrink_to_fit=False):
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((std::shared_ptr< arrow::Buffer> )__pyx_v_buffer));

  /* "pyarrow/io.pxi":1066
 *     """
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":1069
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 *     def resize(self, int64_t new_size, shrink_to_fit=False):             # <<<<<<<<<<<<<<
 *         """
 *         Resize buffer to indicated size.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ResizableBuffer_resize[] = "ResizableBuffer.resize(self, int64_t new_size, shrink_to_fit=False)\n\n        Resize buffer to indicated size.\n\n        Parameters\n        ----------\n        new_size : int\n            New size of buffer (padding may be added internally)\n        shrink_to_fit : boolean, default False\n            If this is true, the buffer is shrunk when new_size is less\n            than the current size.\n            If this is false, the buffer is never shrunk.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_new_size;
  PyObject *__pyx_v_shrink_to_fit = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_new_size,&__pyx_n_s_shrink_to_fit,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shrink_to_fit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(6, 1069, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_new_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_new_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1069, __pyx_L3_error)
    __pyx_v_shrink_to_fit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1069, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ResizableBuffer.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ResizableBuffer_resize(((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_v_self), __pyx_v_new_size, __pyx_v_shrink_to_fit);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15ResizableBuffer_resize(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, int64_t __pyx_v_new_size, PyObject *__pyx_v_shrink_to_fit) {
  bool __pyx_v_c_shrink_to_fit;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("resize", 0);

  /* "pyarrow/io.pxi":1082
 *             If this is false, the buffer is never shrunk.
 *         """
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status((<CResizableBuffer*> self.buffer.get())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shrink_to_fit); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1082, __pyx_L1_error)
  __pyx_v_c_shrink_to_fit = __pyx_t_1;

  /* "pyarrow/io.pxi":1083
 *         """
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status((<CResizableBuffer*> self.buffer.get())
 *                          .Resize(new_size, c_shrink_to_fit))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1084
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit
 *         with nogil:
 *             check_status((<CResizableBuffer*> self.buffer.get())             # <<<<<<<<<<<<<<
 *                          .Resize(new_size, c_shrink_to_fit))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status((( arrow::ResizableBuffer *)__pyx_v_self->__pyx_base.buffer.get())->Resize(__pyx_v_new_size, __pyx_v_c_shrink_to_fit)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1084, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1083
 *         """
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status((<CResizableBuffer*> self.buffer.get())
 *                          .Resize(new_size, c_shrink_to_fit))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1069
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 *     def resize(self, int64_t new_size, shrink_to_fit=False):             # <<<<<<<<<<<<<<
 *         """
 *         Resize buffer to indicated size.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ResizableBuffer.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1088
 * 
 * 
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:
 */

static std::shared_ptr< arrow::ResizableBuffer>  __pyx_f_7pyarrow_3lib__allocate_buffer( arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr< arrow::ResizableBuffer>  __pyx_v_result;
  std::shared_ptr< arrow::ResizableBuffer>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_allocate_buffer", 0);

  /* "pyarrow/io.pxi":1090
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1091
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:
 *         check_status(AllocateResizableBuffer(pool, 0, &result))             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::AllocateResizableBuffer(__pyx_v_pool, 0, (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1091, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1090
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1092
 *     with nogil:
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1088
 * 
 * 
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pyarrow.lib._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1095
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_155allocate_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_154allocate_buffer[] = "allocate_buffer(int64_t size, MemoryPool memory_pool=None, resizable=False)\n\n    Allocate a mutable buffer.\n\n    Parameters\n    ----------\n    size : int\n        Number of bytes to allocate (plus internal padding)\n    memory_pool : MemoryPool, optional\n        The pool to allocate memory from.\n        If not given, the default memory pool is used.\n    resizable : boolean, default False\n        If true, the returned buffer is resizable.\n\n    Returns\n    -------\n    buffer : Buffer or ResizableBuffer\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_155allocate_buffer = {"allocate_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_155allocate_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_154allocate_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_155allocate_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_v_resizable = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("allocate_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_memory_pool,&__pyx_n_s_resizable,0};
    PyObject* values[3] = {0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);

    /* "pyarrow/io.pxi":1096
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,
 *                     resizable=False):             # <<<<<<<<<<<<<<
 *     """
 *     Allocate a mutable buffer.
 */
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resizable);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allocate_buffer") < 0)) __PYX_ERR(6, 1095, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1095, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[1]);
    __pyx_v_resizable = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("allocate_buffer", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1095, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1095, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_154allocate_buffer(__pyx_self, __pyx_v_size, __pyx_v_memory_pool, __pyx_v_resizable);

  /* "pyarrow/io.pxi":1095
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_154allocate_buffer(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool, PyObject *__pyx_v_resizable) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buffer;
  std::shared_ptr< arrow::ResizableBuffer>  __pyx_v_rz_buffer;
   arrow::MemoryPool *__pyx_v_cpool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("allocate_buffer", 0);

  /* "pyarrow/io.pxi":1117
 *         shared_ptr[CBuffer] buffer
 *         shared_ptr[CResizableBuffer] rz_buffer
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     if resizable:
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1119
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if resizable:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_resizable); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1119, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1120
 * 
 *     if resizable:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":1121
 *     if resizable:
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 *     else:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::AllocateResizableBuffer(__pyx_v_cpool, __pyx_v_size, (&__pyx_v_rz_buffer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1121, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":1120
 * 
 *     if resizable:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":1122
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)             # <<<<<<<<<<<<<<
 *     else:
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer(__pyx_v_rz_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1119
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if resizable:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 */
  }

  /* "pyarrow/io.pxi":1124
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 *     else:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateBuffer(cpool, size, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":1125
 *     else:
 *         with nogil:
 *             check_status(AllocateBuffer(cpool, size, &buffer))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(buffer)
 * 
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::AllocateBuffer(__pyx_v_cpool, __pyx_v_size, (&__pyx_v_buffer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1125, __pyx_L8_error)
        }

        /* "pyarrow/io.pxi":1124
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 *     else:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateBuffer(cpool, size, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }

    /* "pyarrow/io.pxi":1126
 *         with nogil:
 *             check_status(AllocateBuffer(cpool, size, &buffer))
 *         return pyarrow_wrap_buffer(buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1095
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1134
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 1134, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1134, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1134, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream___cinit__(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_18BufferOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1135
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CBufferOutputStream(
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 */
  __pyx_v_self->buffer = __pyx_f_7pyarrow_3lib__allocate_buffer(__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool));

  /* "pyarrow/io.pxi":1136
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(             # <<<<<<<<<<<<<<
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::BufferOutputStream(((std::shared_ptr< arrow::ResizableBuffer> )__pyx_v_self->buffer)));

  /* "pyarrow/io.pxi":1138
 *         self.output_stream.reset(new CBufferOutputStream(
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def getvalue(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1134
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1140
 *         self.is_writable = True
 * 
 *     def getvalue(self):             # <<<<<<<<<<<<<<
 *         """
 *         Finalize output stream and return result as pyarrow.Buffer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_2getvalue[] = "BufferOutputStream.getvalue(self)\n\n        Finalize output stream and return result as pyarrow.Buffer.\n\n        Returns\n        -------\n        value : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getvalue (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getvalue", 0);

  /* "pyarrow/io.pxi":1148
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1149
 *         """
 *         with nogil:
 *             check_status(self.output_stream.get().Close())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->__pyx_base.output_stream.get()->Close()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1149, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1148
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1150
 *         with nogil:
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(((std::shared_ptr< arrow::Buffer> )__pyx_v_self->buffer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1140
 *         self.is_writable = True
 * 
 *     def getvalue(self):             # <<<<<<<<<<<<<<
 *         """
 *         Finalize output stream and return result as pyarrow.Buffer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.getvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__[] = "BufferOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__[] = "BufferOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1155
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1156
 * 
 *     def __cinit__(self):
 *         self.output_stream.reset(new CMockOutputStream())             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::MockOutputStream());

  /* "pyarrow/io.pxi":1157
 *     def __cinit__(self):
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1155
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1159
 *         self.is_writable = True
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_2size[] = "MockOutputStream.size(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
   arrow::io::MockOutputStream *__pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("size", 0);

  /* "pyarrow/io.pxi":1160
 * 
 *     def size(self):
 *         handle = <CMockOutputStream*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         return handle.GetExtentBytesWritten()
 * 
 */
  __pyx_v_handle = (( arrow::io::MockOutputStream *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":1161
 *     def size(self):
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_handle->GetExtentBytesWritten()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1159
 *         self.is_writable = True
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MockOutputStream.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__[] = "MockOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MockOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__[] = "MockOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MockOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1175
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_12BufferReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_12BufferReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 1175, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1175, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self), __pyx_v_obj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1176
 * 
 *     def __cinit__(self, object obj):
 *         self.buffer = as_buffer(obj)             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 *             new CBufferReader(self.buffer.buffer)))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(6, 1176, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->buffer);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->buffer));
  __pyx_v_self->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1177
 *     def __cinit__(self, object obj):
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](             # <<<<<<<<<<<<<<
 *             new CBufferReader(self.buffer.buffer)))
 *         self.is_readable = True
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr<arrow::io::RandomAccessFile> (new  arrow::io::BufferReader(__pyx_v_self->buffer->buffer))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1179
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 *             new CBufferReader(self.buffer.buffer)))
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1175
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 */

  /* 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.lib.BufferReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BufferReader_2__reduce_cython__[] = "BufferReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BufferReader_4__setstate_cython__[] = "BufferReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1192
 *         The compression type ("bz2", "brotli", "gzip", "lz4" or "zstd")
 *     """
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_compression = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_compression,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 1192, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1192, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_compression = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1192, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1192, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_compression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr< arrow::io::CompressedInputStream>  __pyx_v_compressed_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_7;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1198
 *             shared_ptr[CCompressedInputStream] compressed_stream
 * 
 *         compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1198, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1199
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  __pyx_t_2 = ((__pyx_v_compression_type ==  arrow::Compression::UNCOMPRESSED) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":1201
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))             # <<<<<<<<<<<<<<
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_for_compression_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_compression) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_compression);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1200
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'             # <<<<<<<<<<<<<<
 *                              .format(compression))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(6, 1200, __pyx_L1_error)

    /* "pyarrow/io.pxi":1199
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  }

  /* "pyarrow/io.pxi":1203
 *                              .format(compression))
 * 
 *         check_status(CCodec.Create(compression_type, &codec))             # <<<<<<<<<<<<<<
 *         check_status(CCompressedInputStream.Make(
 *             codec.get(), stream.get_input_stream(), &compressed_stream))
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_compression_type, (&__pyx_v_codec))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1203, __pyx_L1_error)

  /* "pyarrow/io.pxi":1205
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(
 *             codec.get(), stream.get_input_stream(), &compressed_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> compressed_stream)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_input_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1205, __pyx_L1_error)

  /* "pyarrow/io.pxi":1204
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(             # <<<<<<<<<<<<<<
 *             codec.get(), stream.get_input_stream(), &compressed_stream))
 * 
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::CompressedInputStream::Make(__pyx_v_codec.get(), __pyx_t_7, (&__pyx_v_compressed_stream))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1204, __pyx_L1_error)

  /* "pyarrow/io.pxi":1207
 *             codec.get(), stream.get_input_stream(), &compressed_stream))
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> compressed_stream)             # <<<<<<<<<<<<<<
 *         self.is_readable = True
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_input_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_compressed_stream)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":1208
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> compressed_stream)
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1192
 *         The compression type ("bz2", "brotli", "gzip", "lz4" or "zstd")
 *     """
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__[] = "CompressedInputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__[] = "CompressedInputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1222
 *     """
 * 
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_compression = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_compression,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 1222, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1222, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_compression = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1222, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1222, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_compression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr< arrow::io::CompressedOutputStream>  __pyx_v_compressed_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_7;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1228
 *             shared_ptr[CCompressedOutputStream] compressed_stream
 * 
 *         compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1228, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1229
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  __pyx_t_2 = ((__pyx_v_compression_type ==  arrow::Compression::UNCOMPRESSED) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":1231
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))             # <<<<<<<<<<<<<<
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_for_compression_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_compression) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_compression);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1230
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'             # <<<<<<<<<<<<<<
 *                              .format(compression))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(6, 1230, __pyx_L1_error)

    /* "pyarrow/io.pxi":1229
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  }

  /* "pyarrow/io.pxi":1233
 *                              .format(compression))
 * 
 *         check_status(CCodec.Create(compression_type, &codec))             # <<<<<<<<<<<<<<
 *         check_status(CCompressedOutputStream.Make(
 *             codec.get(), stream.get_output_stream(), &compressed_stream))
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_compression_type, (&__pyx_v_codec))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1233, __pyx_L1_error)

  /* "pyarrow/io.pxi":1235
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedOutputStream.Make(
 *             codec.get(), stream.get_output_stream(), &compressed_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> compressed_stream)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_output_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1235, __pyx_L1_error)

  /* "pyarrow/io.pxi":1234
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedOutputStream.Make(             # <<<<<<<<<<<<<<
 *             codec.get(), stream.get_output_stream(), &compressed_stream))
 * 
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::CompressedOutputStream::Make(__pyx_v_codec.get(), __pyx_t_7, (&__pyx_v_compressed_stream))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1234, __pyx_L1_error)

  /* "pyarrow/io.pxi":1237
 *             codec.get(), stream.get_output_stream(), &compressed_stream))
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> compressed_stream)             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_compressed_stream)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":1238
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> compressed_stream)
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1222
 *     """
 * 
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__[] = "CompressedOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__[] = "CompressedOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1248
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  int __pyx_v_buffer_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/io.pxi":1249
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(6, 1248, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1248, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1248, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1248, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1248, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1249, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1248
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::io::BufferedInputStream>  __pyx_v_buffered_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1252
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedInputStream.Create(
 */
  __pyx_t_1 = ((__pyx_v_buffer_size <= 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1253
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         check_status(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1253, __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(6, 1253, __pyx_L1_error)

    /* "pyarrow/io.pxi":1252
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedInputStream.Create(
 */
  }

  /* "pyarrow/io.pxi":1256
 *         check_status(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_input_stream(), &buffered_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> buffered_stream)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_input_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1256, __pyx_L1_error)

  /* "pyarrow/io.pxi":1254
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedInputStream.Create(             # <<<<<<<<<<<<<<
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_input_stream(), &buffered_stream))
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::BufferedInputStream::Create(__pyx_v_buffer_size, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool), __pyx_t_3, (&__pyx_v_buffered_stream))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 1254, __pyx_L1_error)

  /* "pyarrow/io.pxi":1258
 *             stream.get_input_stream(), &buffered_stream))
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> buffered_stream)             # <<<<<<<<<<<<<<
 *         self.is_readable = True
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_input_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_buffered_stream)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":1259
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> buffered_stream)
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 *     def detach(self):
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1248
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1261
 *         self.is_readable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Release the raw InputStream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_2detach[] = "BufferedInputStream.detach(self)\n\n        Release the raw InputStream.\n        Further operations on this stream are invalid.\n\n        Returns\n        -------\n        raw : NativeFile\n            The underlying raw input stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("detach (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream_2detach(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self) {
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_c_raw;
  __pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr __pyx_v_buffered;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_raw = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __pyx_t_7pyarrow_3lib__RandomAccessFilePtr __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("detach", 0);

  /* "pyarrow/io.pxi":1276
 *             NativeFile raw
 * 
 *         buffered = dynamic_cast[_CBufferedInputStreamPtr](             # <<<<<<<<<<<<<<
 *             self.input_stream.get())
 *         assert buffered != nullptr
 */
  try {
    __pyx_t_1 = dynamic_cast<__pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr>(__pyx_v_self->__pyx_base.input_stream.get());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(6, 1276, __pyx_L1_error)
  }
  __pyx_v_buffered = __pyx_t_1;

  /* "pyarrow/io.pxi":1278
 *         buffered = dynamic_cast[_CBufferedInputStreamPtr](
 *             self.input_stream.get())
 *         assert buffered != nullptr             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_buffered != nullptr) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(6, 1278, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/io.pxi":1280
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_raw = buffered.Detach()
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1281
 * 
 *         with nogil:
 *             c_raw = buffered.Detach()             # <<<<<<<<<<<<<<
 * 
 *         raw = NativeFile()
 */
        __pyx_v_c_raw = __pyx_v_buffered->Detach();
      }

      /* "pyarrow/io.pxi":1280
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_raw = buffered.Detach()
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1283
 *             c_raw = buffered.Detach()
 * 
 *         raw = NativeFile()             # <<<<<<<<<<<<<<
 *         raw.is_readable = True
 *         # Find out whether the raw stream is a RandomAccessFile
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_raw = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":1284
 * 
 *         raw = NativeFile()
 *         raw.is_readable = True             # <<<<<<<<<<<<<<
 *         # Find out whether the raw stream is a RandomAccessFile
 *         # or a mere InputStream.  This helps us support seek() etc.
 */
  __pyx_v_raw->is_readable = 1;

  /* "pyarrow/io.pxi":1288
 *         # or a mere InputStream.  This helps us support seek() etc.
 *         # selectively.
 *         if dynamic_cast[_RandomAccessFilePtr](c_raw.get()) != nullptr:             # <<<<<<<<<<<<<<
 *             raw.set_random_access_file(
 *                 static_pointer_cast[RandomAccessFile, InputStream](c_raw))
 */
  try {
    __pyx_t_3 = dynamic_cast<__pyx_t_7pyarrow_3lib__RandomAccessFilePtr>(__pyx_v_c_raw.get());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(6, 1288, __pyx_L1_error)
  }
  __pyx_t_4 = ((__pyx_t_3 != nullptr) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1289
 *         # selectively.
 *         if dynamic_cast[_RandomAccessFilePtr](c_raw.get()) != nullptr:
 *             raw.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 static_pointer_cast[RandomAccessFile, InputStream](c_raw))
 *         else:
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_raw->__pyx_vtab)->set_random_access_file(__pyx_v_raw, std::static_pointer_cast<arrow::io::RandomAccessFile,arrow::io::InputStream>(__pyx_v_c_raw)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":1288
 *         # or a mere InputStream.  This helps us support seek() etc.
 *         # selectively.
 *         if dynamic_cast[_RandomAccessFilePtr](c_raw.get()) != nullptr:             # <<<<<<<<<<<<<<
 *             raw.set_random_access_file(
 *                 static_pointer_cast[RandomAccessFile, InputStream](c_raw))
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io.pxi":1292
 *                 static_pointer_cast[RandomAccessFile, InputStream](c_raw))
 *         else:
 *             raw.set_input_stream(c_raw)             # <<<<<<<<<<<<<<
 *         return raw
 * 
 */
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_raw->__pyx_vtab)->set_input_stream(__pyx_v_raw, __pyx_v_c_raw); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "pyarrow/io.pxi":1293
 *         else:
 *             raw.set_input_stream(c_raw)
 *         return raw             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_raw));
  __pyx_r = ((PyObject *)__pyx_v_raw);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1261
 *         self.is_readable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Release the raw InputStream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.detach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_raw);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__[] = "BufferedInputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__[] = "BufferedInputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1298
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  int __pyx_v_buffer_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/io.pxi":1299
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(6, 1298, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1298, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1298, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1298, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1298, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1299, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1298
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::io::BufferedOutputStream>  __pyx_v_buffered_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1302
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedOutputStream.Create(
 */
  __pyx_t_1 = ((__pyx_v_buffer_size <= 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1303
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         check_status(CBufferedOutputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1303, __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(6, 1303, __pyx_L1_error)

    /* "pyarrow/io.pxi":1302
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedOutputStream.Create(
 */
  }

  /* "pyarrow/io.pxi":1306
 *         check_status(CBufferedOutputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_output_stream(), &buffered_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> buffered_stream)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_output_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1306, __pyx_L1_error)

  /* "pyarrow/io.pxi":1304
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedOutputStream.Create(             # <<<<<<<<<<<<<<
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_output_stream(), &buffered_stream))
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::BufferedOutputStream::Create(__pyx_v_buffer_size, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool), __pyx_t_3, (&__pyx_v_buffered_stream))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 1304, __pyx_L1_error)

  /* "pyarrow/io.pxi":1308
 *             stream.get_output_stream(), &buffered_stream))
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> buffered_stream)             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_buffered_stream)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":1309
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> buffered_stream)
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def detach(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1298
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1311
 *         self.is_writable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush any buffered writes and release the raw OutputStream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_2detach[] = "BufferedOutputStream.detach(self)\n\n        Flush any buffered writes and release the raw OutputStream.\n        Further operations on this stream are invalid.\n\n        Returns\n        -------\n        raw : NativeFile\n            The underlying raw output stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("detach (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2detach(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self) {
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_c_raw;
  __pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr __pyx_v_buffered;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_raw = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("detach", 0);

  /* "pyarrow/io.pxi":1326
 *             NativeFile raw
 * 
 *         buffered = dynamic_cast[_CBufferedOutputStreamPtr](             # <<<<<<<<<<<<<<
 *             self.output_stream.get())
 *         assert buffered != nullptr
 */
  try {
    __pyx_t_1 = dynamic_cast<__pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr>(__pyx_v_self->__pyx_base.output_stream.get());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(6, 1326, __pyx_L1_error)
  }
  __pyx_v_buffered = __pyx_t_1;

  /* "pyarrow/io.pxi":1328
 *         buffered = dynamic_cast[_CBufferedOutputStreamPtr](
 *             self.output_stream.get())
 *         assert buffered != nullptr             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_buffered != nullptr) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(6, 1328, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/io.pxi":1330
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(buffered.Detach(&c_raw))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1331
 * 
 *         with nogil:
 *             check_status(buffered.Detach(&c_raw))             # <<<<<<<<<<<<<<
 * 
 *         raw = NativeFile()
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_buffered->Detach((&__pyx_v_c_raw))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1331, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1330
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(buffered.Detach(&c_raw))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1333
 *             check_status(buffered.Detach(&c_raw))
 * 
 *         raw = NativeFile()             # <<<<<<<<<<<<<<
 *         raw.is_writable = True
 *         raw.set_output_stream(c_raw)
 */
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_raw = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":1334
 * 
 *         raw = NativeFile()
 *         raw.is_writable = True             # <<<<<<<<<<<<<<
 *         raw.set_output_stream(c_raw)
 *         return raw
 */
  __pyx_v_raw->is_writable = 1;

  /* "pyarrow/io.pxi":1335
 *         raw = NativeFile()
 *         raw.is_writable = True
 *         raw.set_output_stream(c_raw)             # <<<<<<<<<<<<<<
 *         return raw
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_raw->__pyx_vtab)->set_output_stream(__pyx_v_raw, __pyx_v_c_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":1336
 *         raw.is_writable = True
 *         raw.set_output_stream(c_raw)
 *         return raw             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_raw));
  __pyx_r = ((PyObject *)__pyx_v_raw);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1311
 *         self.is_writable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush any buffered writes and release the raw OutputStream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.detach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_raw);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__[] = "BufferedOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__[] = "BufferedOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1339
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_157py_buffer(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_156py_buffer[] = "py_buffer(obj)\n\n    Construct an Arrow buffer from a Python bytes-like or buffer-like object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_157py_buffer = {"py_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_157py_buffer, METH_O, __pyx_doc_7pyarrow_3lib_156py_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_157py_buffer(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("py_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_156py_buffer(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_156py_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("py_buffer", 0);

  /* "pyarrow/io.pxi":1344
 *     """
 *     cdef shared_ptr[CBuffer] buf
 *     check_status(PyBuffer.FromPyObject(obj, &buf))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_buffer(buf)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::PyBuffer::FromPyObject(__pyx_v_obj, (&__pyx_v_buf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1344, __pyx_L1_error)

  /* "pyarrow/io.pxi":1345
 *     cdef shared_ptr[CBuffer] buf
 *     check_status(PyBuffer.FromPyObject(obj, &buf))
 *     return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1339
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.py_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1348
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_159foreign_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_158foreign_buffer[] = "foreign_buffer(address, size, base=None)\n\n    Construct an Arrow buffer with the given *address* and *size*,\n    optionally backed by the Python *base* object.\n\n    The *base* object, if given, will be kept alive as long as this buffer\n    is alive, including accross language boundaries (for example if the\n    buffer is referenced by C++ code).\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_159foreign_buffer = {"foreign_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_159foreign_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_158foreign_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_159foreign_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_address = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("foreign_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_size,&__pyx_n_s_base,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("foreign_buffer", 0, 2, 3, 1); __PYX_ERR(6, 1348, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "foreign_buffer") < 0)) __PYX_ERR(6, 1348, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_address = values[0];
    __pyx_v_size = values[1];
    __pyx_v_base = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("foreign_buffer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1348, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.foreign_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_158foreign_buffer(__pyx_self, __pyx_v_address, __pyx_v_size, __pyx_v_base);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_158foreign_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_size, PyObject *__pyx_v_base) {
  intptr_t __pyx_v_c_addr;
  int64_t __pyx_v_c_size;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int64_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("foreign_buffer", 0);

  /* "pyarrow/io.pxi":1358
 *     """
 *     cdef:
 *         intptr_t c_addr = address             # <<<<<<<<<<<<<<
 *         int64_t c_size = size
 *         shared_ptr[CBuffer] buf
 */
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_address); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1358, __pyx_L1_error)
  __pyx_v_c_addr = __pyx_t_1;

  /* "pyarrow/io.pxi":1359
 *     cdef:
 *         intptr_t c_addr = address
 *         int64_t c_size = size             # <<<<<<<<<<<<<<
 *         shared_ptr[CBuffer] buf
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_v_size); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1359, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_2;

  /* "pyarrow/io.pxi":1362
 *         shared_ptr[CBuffer] buf
 * 
 *     check_status(PyForeignBuffer.Make(<uint8_t*> c_addr, c_size,             # <<<<<<<<<<<<<<
 *                                       base, &buf))
 *     return pyarrow_wrap_buffer(buf)
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::PyForeignBuffer::Make(((uint8_t *)__pyx_v_c_addr), __pyx_v_c_size, __pyx_v_base, (&__pyx_v_buf))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 1362, __pyx_L1_error)

  /* "pyarrow/io.pxi":1364
 *     check_status(PyForeignBuffer.Make(<uint8_t*> c_addr, c_size,
 *                                       base, &buf))
 *     return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1348
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.foreign_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1367
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_161as_buffer(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/
static char __pyx_doc_7pyarrow_3lib_160as_buffer[] = "as_buffer(o)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_161as_buffer = {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_161as_buffer, METH_O, __pyx_doc_7pyarrow_3lib_160as_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_161as_buffer(PyObject *__pyx_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_160as_buffer(__pyx_self, ((PyObject *)__pyx_v_o));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_160as_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/io.pxi":1368
 * 
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         return o
 *     return py_buffer(o)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1369
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):
 *         return o             # <<<<<<<<<<<<<<
 *     return py_buffer(o)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_o);
    __pyx_r = __pyx_v_o;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1368
 * 
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         return o
 *     return py_buffer(o)
 */
  }

  /* "pyarrow/io.pxi":1370
 *     if isinstance(o, Buffer):
 *         return o
 *     return py_buffer(o)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_o) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_o);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1367
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1373
 * 
 * 
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):
 */

static std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_as_c_buffer(PyObject *__pyx_v_o) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  std::shared_ptr< arrow::Buffer>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::shared_ptr< arrow::Buffer>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("as_c_buffer", 0);

  /* "pyarrow/io.pxi":1375
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1376
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):
 *         buf = (<Buffer> o).buffer             # <<<<<<<<<<<<<<
 *         if buf == nullptr:
 *             raise ValueError("got null buffer")
 */
    __pyx_t_3 = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_o)->buffer;
    __pyx_v_buf = __pyx_t_3;

    /* "pyarrow/io.pxi":1377
 *     if isinstance(o, Buffer):
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("got null buffer")
 *     else:
 */
    __pyx_t_2 = ((__pyx_v_buf == nullptr) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/io.pxi":1378
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 *             raise ValueError("got null buffer")             # <<<<<<<<<<<<<<
 *     else:
 *         check_status(PyBuffer.FromPyObject(o, &buf))
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1378, __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(6, 1378, __pyx_L1_error)

      /* "pyarrow/io.pxi":1377
 *     if isinstance(o, Buffer):
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("got null buffer")
 *     else:
 */
    }

    /* "pyarrow/io.pxi":1375
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":1380
 *             raise ValueError("got null buffer")
 *     else:
 *         check_status(PyBuffer.FromPyObject(o, &buf))             # <<<<<<<<<<<<<<
 *     return buf
 * 
 */
  /*else*/ {
    __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::PyBuffer::FromPyObject(__pyx_v_o, (&__pyx_v_buf))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 1380, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":1381
 *     else:
 *         check_status(PyBuffer.FromPyObject(o, &buf))
 *     return buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1373
 * 
 * 
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.as_c_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1384
 * 
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):             # <<<<<<<<<<<<<<
 *     try:
 *         source_path = _stringify_path(source)
 */

static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib__get_native_file(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map) {
  PyObject *__pyx_v_source_path = NULL;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("_get_native_file", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1385
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __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/io.pxi":1386
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if isinstance(source, Buffer):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1386, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1386, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1385
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1394
 *             source = PythonFile(source, mode='r')
 *     else:
 *         if use_memory_map:             # <<<<<<<<<<<<<<
 *             source = memory_map(source_path, mode='r')
 *         else:
 */
    /*else:*/ {
      __pyx_t_7 = (__pyx_v_use_memory_map != 0);
      if (__pyx_t_7) {

        /* "pyarrow/io.pxi":1395
 *     else:
 *         if use_memory_map:
 *             source = memory_map(source_path, mode='r')             # <<<<<<<<<<<<<<
 *         else:
 *             source = OSFile(source_path, mode='r')
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_memory_map); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1395, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1395, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_source_path);
        __Pyx_GIVEREF(__pyx_v_source_path);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_source_path);
        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1395, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(6, 1395, __pyx_L5_except_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1395, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __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_SET(__pyx_v_source, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "pyarrow/io.pxi":1394
 *             source = PythonFile(source, mode='r')
 *     else:
 *         if use_memory_map:             # <<<<<<<<<<<<<<
 *             source = memory_map(source_path, mode='r')
 *         else:
 */
        goto __pyx_L9;
      }

      /* "pyarrow/io.pxi":1397
 *             source = memory_map(source_path, mode='r')
 *         else:
 *             source = OSFile(source_path, mode='r')             # <<<<<<<<<<<<<<
 * 
 *     return source
 */
      /*else*/ {
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1397, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_source_path);
        __Pyx_GIVEREF(__pyx_v_source_path);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_source_path);
        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1397, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(6, 1397, __pyx_L5_except_error)
        __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1397, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_5);
        __pyx_t_5 = 0;
      }
      __pyx_L9:;
    }
    __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;

    /* "pyarrow/io.pxi":1387
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pyarrow.lib._get_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(6, 1387, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);

      /* "pyarrow/io.pxi":1388
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if isinstance(source, Buffer):             # <<<<<<<<<<<<<<
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 */
      __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
      __pyx_t_10 = (__pyx_t_7 != 0);
      if (__pyx_t_10) {

        /* "pyarrow/io.pxi":1389
 *     except TypeError:
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)             # <<<<<<<<<<<<<<
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 *             # Optimistically hope this is file-like
 */
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_v_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1389, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "pyarrow/io.pxi":1388
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if isinstance(source, Buffer):             # <<<<<<<<<<<<<<
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 */
        goto __pyx_L12;
      }

      /* "pyarrow/io.pxi":1390
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='r')
 */
      __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
      __pyx_t_11 = ((!(__pyx_t_7 != 0)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_11 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(6, 1390, __pyx_L5_except_error)
      __pyx_t_7 = (__pyx_t_11 != 0);
      __pyx_t_10 = __pyx_t_7;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_10) {

        /* "pyarrow/io.pxi":1392
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='r')             # <<<<<<<<<<<<<<
 *     else:
 *         if use_memory_map:
 */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1392, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_source);
        __Pyx_GIVEREF(__pyx_v_source);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source);
        __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 1392, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(6, 1392, __pyx_L5_except_error)
        __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 1392, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "pyarrow/io.pxi":1390
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='r')
 */
      }
      __pyx_L12:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1385
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __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_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/io.pxi":1399
 *             source = OSFile(source_path, mode='r')
 * 
 *     return source             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1399, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_source);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_source);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1384
 * 
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):             # <<<<<<<<<<<<<<
 *     try:
 *         source_path = _stringify_path(source)
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib._get_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1402
 * 
 * 
 * cdef get_reader(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                 shared_ptr[RandomAccessFile]* reader):
 *     cdef NativeFile nf
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_reader(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map, std::shared_ptr<arrow::io::RandomAccessFile>  *__pyx_v_reader) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_2;
  __Pyx_RefNannySetupContext("get_reader", 0);

  /* "pyarrow/io.pxi":1406
 *     cdef NativeFile nf
 * 
 *     nf = _get_native_file(source, use_memory_map)             # <<<<<<<<<<<<<<
 *     reader[0] = nf.get_random_access_file()
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib__get_native_file(__pyx_v_source, __pyx_v_use_memory_map)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1407
 * 
 *     nf = _get_native_file(source, use_memory_map)
 *     reader[0] = nf.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_random_access_file(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1407, __pyx_L1_error)
  (__pyx_v_reader[0]) = __pyx_t_2;

  /* "pyarrow/io.pxi":1402
 * 
 * 
 * cdef get_reader(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                 shared_ptr[RandomAccessFile]* reader):
 *     cdef NativeFile nf
 */

  /* 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.lib.get_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1410
 * 
 * 
 * cdef get_input_stream(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                       shared_ptr[InputStream]* out):
 *     """
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_input_stream(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map, std::shared_ptr<arrow::io::InputStream>  *__pyx_v_out) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_input_stream;
  std::shared_ptr< arrow::io::CompressedInputStream>  __pyx_v_compressed_stream;
  enum  arrow::Compression::type __pyx_v_compression_type;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_v_compression = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  enum  arrow::Compression::type __pyx_t_8;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("get_input_stream", 0);

  /* "pyarrow/io.pxi":1423
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __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/io.pxi":1424
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         compression = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1424, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1424, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1423
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1428
 *         compression = None
 *     else:
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     compression_type = _get_compression_type(compression)
 */
    /*else:*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1428, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source_path);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1428, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_compression = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __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;

    /* "pyarrow/io.pxi":1425
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         compression = None
 *     else:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 1425, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1426
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         compression = None             # <<<<<<<<<<<<<<
 *     else:
 *         compression = _detect_compression(source_path)
 */
      __Pyx_INCREF(Py_None);
      __pyx_v_compression = Py_None;
      __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_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1423
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __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_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/io.pxi":1430
 *         compression = _detect_compression(source_path)
 * 
 *     compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *     nf = _get_native_file(source, use_memory_map)
 *     input_stream = nf.get_input_stream()
 */
  __pyx_t_8 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1430, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_8;

  /* "pyarrow/io.pxi":1431
 * 
 *     compression_type = _get_compression_type(compression)
 *     nf = _get_native_file(source, use_memory_map)             # <<<<<<<<<<<<<<
 *     input_stream = nf.get_input_stream()
 * 
 */
  __pyx_t_6 = ((PyObject *)__pyx_f_7pyarrow_3lib__get_native_file(__pyx_v_source, __pyx_v_use_memory_map)); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyarrow/io.pxi":1432
 *     compression_type = _get_compression_type(compression)
 *     nf = _get_native_file(source, use_memory_map)
 *     input_stream = nf.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:
 */
  __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_input_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1432, __pyx_L1_error)
  __pyx_v_input_stream = __pyx_t_9;

  /* "pyarrow/io.pxi":1434
 *     input_stream = nf.get_input_stream()
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 */
  __pyx_t_10 = ((__pyx_v_compression_type !=  arrow::Compression::UNCOMPRESSED) != 0);
  if (__pyx_t_10) {

    /* "pyarrow/io.pxi":1435
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:
 *         check_status(CCodec.Create(compression_type, &codec))             # <<<<<<<<<<<<<<
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 *                                                  &compressed_stream))
 */
    __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_compression_type, (&__pyx_v_codec))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1435, __pyx_L1_error)

    /* "pyarrow/io.pxi":1436
 *     if compression_type != CompressionType_UNCOMPRESSED:
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,             # <<<<<<<<<<<<<<
 *                                                  &compressed_stream))
 *         input_stream = <shared_ptr[InputStream]> compressed_stream
 */
    __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::CompressedInputStream::Make(__pyx_v_codec.get(), __pyx_v_input_stream, (&__pyx_v_compressed_stream))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1436, __pyx_L1_error)

    /* "pyarrow/io.pxi":1438
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 *                                                  &compressed_stream))
 *         input_stream = <shared_ptr[InputStream]> compressed_stream             # <<<<<<<<<<<<<<
 * 
 *     out[0] = input_stream
 */
    __pyx_v_input_stream = ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_compressed_stream);

    /* "pyarrow/io.pxi":1434
 *     input_stream = nf.get_input_stream()
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 */
  }

  /* "pyarrow/io.pxi":1440
 *         input_stream = <shared_ptr[InputStream]> compressed_stream
 * 
 *     out[0] = input_stream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  (__pyx_v_out[0]) = __pyx_v_input_stream;

  /* "pyarrow/io.pxi":1410
 * 
 * 
 * cdef get_input_stream(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                       shared_ptr[InputStream]* out):
 *     """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1443
 * 
 * 
 * cdef get_writer(object source, shared_ptr[OutputStream]* writer):             # <<<<<<<<<<<<<<
 *     cdef NativeFile nf
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_writer(PyObject *__pyx_v_source, std::shared_ptr<arrow::io::OutputStream>  *__pyx_v_writer) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_14;
  __Pyx_RefNannySetupContext("get_writer", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1446
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __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/io.pxi":1447
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1447, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1447, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1446
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1453
 *             source = PythonFile(source, mode='w')
 *     else:
 *         source = OSFile(source_path, mode='w')             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
    /*else:*/ {
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1453, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_source_path);
      __Pyx_GIVEREF(__pyx_v_source_path);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source_path);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1453, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(6, 1453, __pyx_L5_except_error)
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1453, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_6);
      __pyx_t_6 = 0;
    }
    __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;

    /* "pyarrow/io.pxi":1448
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):
 *             # Optimistically hope this is file-like
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.get_writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(6, 1448, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io.pxi":1449
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='w')
 */
      __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
      __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_8 = __pyx_t_10;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_10 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_write); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1449, __pyx_L5_except_error)
      __pyx_t_9 = (__pyx_t_10 != 0);
      __pyx_t_8 = __pyx_t_9;
      __pyx_L12_bool_binop_done:;
      if (__pyx_t_8) {

        /* "pyarrow/io.pxi":1451
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='w')             # <<<<<<<<<<<<<<
 *     else:
 *         source = OSFile(source_path, mode='w')
 */
        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1451, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_v_source);
        __Pyx_GIVEREF(__pyx_v_source);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_source);
        __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 1451, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(6, 1451, __pyx_L5_except_error)
        __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 1451, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "pyarrow/io.pxi":1449
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='w')
 */
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1446
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __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_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/io.pxi":1455
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 *         writer[0] = nf.get_output_stream()
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (likely(__pyx_t_9)) {

    /* "pyarrow/io.pxi":1456
 * 
 *     if isinstance(source, NativeFile):
 *         nf = source             # <<<<<<<<<<<<<<
 *         writer[0] = nf.get_output_stream()
 *     else:
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1456, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1457
 *     if isinstance(source, NativeFile):
 *         nf = source
 *         writer[0] = nf.get_output_stream()             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 */
    __pyx_t_14 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_output_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1457, __pyx_L1_error)
    (__pyx_v_writer[0]) = __pyx_t_14;

    /* "pyarrow/io.pxi":1455
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 *         writer[0] = nf.get_output_stream()
 */
    goto __pyx_L14;
  }

  /* "pyarrow/io.pxi":1459
 *         writer[0] = nf.get_output_stream()
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1460
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 *                         .format(type(source)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_read_from_object_of_ty, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_source))) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_source)));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1459
 *         writer[0] = nf.get_output_stream()
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 1459, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "pyarrow/io.pxi":1443
 * 
 * 
 * cdef get_writer(object source, shared_ptr[OutputStream]* writer):             # <<<<<<<<<<<<<<
 *     cdef NativeFile nf
 * 
 */

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.get_writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1465
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name) except *:             # <<<<<<<<<<<<<<
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 */

static enum  arrow::Compression::type __pyx_f_7pyarrow_3lib__get_compression_type(PyObject *__pyx_v_name) {
  enum  arrow::Compression::type __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;
  __Pyx_RefNannySetupContext("_get_compression_type", 0);

  /* "pyarrow/io.pxi":1466
 * 
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 */
  __pyx_t_2 = (__pyx_v_name == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_uncompressed, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 1466, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1467
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED             # <<<<<<<<<<<<<<
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 */
    __pyx_r =  arrow::Compression::UNCOMPRESSED;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1466
 * 
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 */
  }

  /* "pyarrow/io.pxi":1468
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':             # <<<<<<<<<<<<<<
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_bz2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1468, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1469
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 *         return CompressionType_BZ2             # <<<<<<<<<<<<<<
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 */
    __pyx_r =  arrow::Compression::BZ2;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1468
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':             # <<<<<<<<<<<<<<
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 */
  }

  /* "pyarrow/io.pxi":1470
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_brotli, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1470, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1471
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI             # <<<<<<<<<<<<<<
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 */
    __pyx_r =  arrow::Compression::BROTLI;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1470
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 */
  }

  /* "pyarrow/io.pxi":1472
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_gzip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1472, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1473
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 *         return CompressionType_GZIP             # <<<<<<<<<<<<<<
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 */
    __pyx_r =  arrow::Compression::GZIP;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1472
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 */
  }

  /* "pyarrow/io.pxi":1474
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_lz4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1474, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1475
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 *         return CompressionType_LZ4             # <<<<<<<<<<<<<<
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 */
    __pyx_r =  arrow::Compression::LZ4;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1474
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 */
  }

  /* "pyarrow/io.pxi":1476
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_snappy, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1476, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1477
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY             # <<<<<<<<<<<<<<
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD
 */
    __pyx_r =  arrow::Compression::SNAPPY;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1476
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 */
  }

  /* "pyarrow/io.pxi":1478
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_zstd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1478, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1479
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Unrecognized compression type: {}'.format(name))
 */
    __pyx_r =  arrow::Compression::ZSTD;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1478
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     else:
 */
  }

  /* "pyarrow/io.pxi":1481
 *         return CompressionType_ZSTD
 *     else:
 *         raise ValueError('Unrecognized compression type: {}'.format(name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unrecognized_compression_type, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 1481, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":1465
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name) except *:             # <<<<<<<<<<<<<<
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_compression_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum  arrow::Compression::type) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_163_detect_compression(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_162_detect_compression[] = "_detect_compression(path)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_163_detect_compression = {"_detect_compression", (PyCFunction)__pyx_pw_7pyarrow_3lib_163_detect_compression, METH_O, __pyx_doc_7pyarrow_3lib_162_detect_compression};
static PyObject *__pyx_pw_7pyarrow_3lib_163_detect_compression(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_detect_compression (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_162_detect_compression(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_162_detect_compression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_detect_compression", 0);

  /* "pyarrow/io.pxi":1485
 * 
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):             # <<<<<<<<<<<<<<
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_path, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 1485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1486
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):             # <<<<<<<<<<<<<<
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_bz2_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_bz2_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1486, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1487
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 *             return 'bz2'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_bz2);
      __pyx_r = __pyx_n_u_bz2;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1486
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):             # <<<<<<<<<<<<<<
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 */
    }

    /* "pyarrow/io.pxi":1488
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 *         elif path.endswith('.gz'):             # <<<<<<<<<<<<<<
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_gz) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_gz);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1488, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1489
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 *             return 'gzip'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_gzip);
      __pyx_r = __pyx_n_u_gzip;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1488
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 *         elif path.endswith('.gz'):             # <<<<<<<<<<<<<<
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 */
    }

    /* "pyarrow/io.pxi":1490
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 *         elif path.endswith('.lz4'):             # <<<<<<<<<<<<<<
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_lz4_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_lz4_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1491
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 *             return 'lz4'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.zst'):
 *             return 'zstd'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_lz4);
      __pyx_r = __pyx_n_u_lz4;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1490
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 *         elif path.endswith('.lz4'):             # <<<<<<<<<<<<<<
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 */
    }

    /* "pyarrow/io.pxi":1492
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 *         elif path.endswith('.zst'):             # <<<<<<<<<<<<<<
 *             return 'zstd'
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_zst) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_zst);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1492, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1493
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 *             return 'zstd'             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_zstd);
      __pyx_r = __pyx_n_u_zstd;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1492
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 *         elif path.endswith('.zst'):             # <<<<<<<<<<<<<<
 *             return 'zstd'
 * 
 */
    }

    /* "pyarrow/io.pxi":1485
 * 
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):             # <<<<<<<<<<<<<<
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 */
  }

  /* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib._detect_compression", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_165compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_164compress[] = "compress(buf, codec=u'lz4', asbytes=False, memory_pool=None)\n\n    Compress data from buffer-like object.\n\n    Parameters\n    ----------\n    buf : pyarrow.Buffer, bytes, or other object supporting buffer protocol\n    codec : string, default 'lz4'\n        Compression codec.\n        Supported types: {'brotli, 'gzip', 'lz4', 'snappy', 'zstd'}\n    asbytes : boolean, default False\n        Return result as Python bytes object, otherwise Buffer\n    memory_pool : MemoryPool, default None\n        Memory pool to use for buffer allocations, if any\n\n    Returns\n    -------\n    compressed : pyarrow.Buffer or bytes (if asbytes=True)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_165compress = {"compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_165compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_164compress};
static PyObject *__pyx_pw_7pyarrow_3lib_165compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  PyObject *__pyx_v_codec = 0;
  PyObject *__pyx_v_asbytes = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,&__pyx_n_s_codec,&__pyx_n_s_asbytes,&__pyx_n_s_memory_pool,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_lz4);
    values[2] = ((PyObject *)Py_False);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asbytes);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compress") < 0)) __PYX_ERR(6, 1496, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_buf = values[0];
    __pyx_v_codec = values[1];
    __pyx_v_asbytes = values[2];
    __pyx_v_memory_pool = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compress", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1496, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_164compress(__pyx_self, __pyx_v_buf, __pyx_v_codec, __pyx_v_asbytes, __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_164compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool) {
  enum  arrow::Compression::type __pyx_v_c_codec;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_compressor;
  std::shared_ptr< arrow::Buffer>  __pyx_v_owned_buf;
   arrow::Buffer *__pyx_v_c_buf;
  PyObject *__pyx_v_pyobj;
  struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_out_buf = 0;
  int64_t __pyx_v_max_output_size;
  uint8_t *__pyx_v_output_buffer;
  int64_t __pyx_v_output_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  std::shared_ptr< arrow::Buffer>  __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("compress", 0);

  /* "pyarrow/io.pxi":1516
 *     """
 *     cdef:
 *         CompressionType c_codec = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] compressor
 *         cdef shared_ptr[CBuffer] owned_buf
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1516, __pyx_L1_error)
  __pyx_v_c_codec = __pyx_t_1;

  /* "pyarrow/io.pxi":1523
 *         cdef ResizableBuffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1524
 * 
 *     with nogil:
 *         check_status(CCodec.Create(c_codec, &compressor))             # <<<<<<<<<<<<<<
 * 
 *     owned_buf = as_c_buffer(buf)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_c_codec, (&__pyx_v_compressor))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1524, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1523
 *         cdef ResizableBuffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1526
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     owned_buf = as_c_buffer(buf)             # <<<<<<<<<<<<<<
 *     c_buf = owned_buf.get()
 * 
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_as_c_buffer(__pyx_v_buf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1526, __pyx_L1_error)
  __pyx_v_owned_buf = __pyx_t_3;

  /* "pyarrow/io.pxi":1527
 * 
 *     owned_buf = as_c_buffer(buf)
 *     c_buf = owned_buf.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t max_output_size = (compressor.get()
 */
  __pyx_v_c_buf = __pyx_v_owned_buf.get();

  /* "pyarrow/io.pxi":1530
 * 
 *     cdef int64_t max_output_size = (compressor.get()
 *                                     .MaxCompressedLen(c_buf.size(),             # <<<<<<<<<<<<<<
 *                                                       c_buf.data()))
 *     cdef uint8_t* output_buffer = NULL
 */
  __pyx_v_max_output_size = __pyx_v_compressor.get()->MaxCompressedLen(__pyx_v_c_buf->size(), __pyx_v_c_buf->data());

  /* "pyarrow/io.pxi":1532
 *                                     .MaxCompressedLen(c_buf.size(),
 *                                                       c_buf.data()))
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1534
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1534, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1535
 * 
 *     if asbytes:
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)             # <<<<<<<<<<<<<<
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 *     else:
 */
    __pyx_t_5 =  PyBytes_FromStringAndSize(NULL, __pyx_v_max_output_size); if (unlikely(__pyx_t_5 == ((PyObject *)NULL))) __PYX_ERR(6, 1535, __pyx_L1_error)
    __pyx_v_pyobj = __pyx_t_5;

    /* "pyarrow/io.pxi":1536
 *     if asbytes:
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)             # <<<<<<<<<<<<<<
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,
 */
    __pyx_v_output_buffer = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_pyobj)));

    /* "pyarrow/io.pxi":1534
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io.pxi":1538
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,             # <<<<<<<<<<<<<<
 *                                   resizable=True)
 *         output_buffer = out_buf.buffer.get().mutable_data()
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_max_output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(6, 1538, __pyx_L1_error)

    /* "pyarrow/io.pxi":1539
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,
 *                                   resizable=True)             # <<<<<<<<<<<<<<
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 */
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_resizable, Py_True) < 0) __PYX_ERR(6, 1538, __pyx_L1_error)

    /* "pyarrow/io.pxi":1538
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,             # <<<<<<<<<<<<<<
 *                                   resizable=True)
 *         output_buffer = out_buf.buffer.get().mutable_data()
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_ResizableBuffer))))) __PYX_ERR(6, 1538, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "pyarrow/io.pxi":1540
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,
 *                                   resizable=True)
 *         output_buffer = out_buf.buffer.get().mutable_data()             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t output_length = 0
 */
    __pyx_v_output_buffer = __pyx_v_out_buf->__pyx_base.buffer.get()->mutable_data();
  }
  __pyx_L6:;

  /* "pyarrow/io.pxi":1542
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     cdef int64_t output_length = 0             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(compressor.get()
 */
  __pyx_v_output_length = 0;

  /* "pyarrow/io.pxi":1543
 * 
 *     cdef int64_t output_length = 0
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Compress(c_buf.size(), c_buf.data(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1544
 *     cdef int64_t output_length = 0
 *     with nogil:
 *         check_status(compressor.get()             # <<<<<<<<<<<<<<
 *                      .Compress(c_buf.size(), c_buf.data(),
 *                                max_output_size, output_buffer,
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_compressor.get()->Compress(__pyx_v_c_buf->size(), __pyx_v_c_buf->data(), __pyx_v_max_output_size, __pyx_v_output_buffer, (&__pyx_v_output_length))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1544, __pyx_L8_error)
      }

      /* "pyarrow/io.pxi":1543
 * 
 *     cdef int64_t output_length = 0
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Compress(c_buf.size(), c_buf.data(),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L8_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L9:;
      }
  }

  /* "pyarrow/io.pxi":1549
 *                                &output_length))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1549, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1550
 * 
 *     if asbytes:
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)             # <<<<<<<<<<<<<<
 *         return PyObject_to_object(pyobj)
 *     else:
 */
    __pyx_t_2 = _PyBytes_Resize((&__pyx_v_pyobj), ((Py_ssize_t)__pyx_v_output_length)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1550, __pyx_L1_error)

    /* "pyarrow/io.pxi":1551
 *     if asbytes:
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)             # <<<<<<<<<<<<<<
 *     else:
 *         out_buf.resize(output_length)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_pyobj); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1549
 *                                &output_length))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  }

  /* "pyarrow/io.pxi":1553
 *         return PyObject_to_object(pyobj)
 *     else:
 *         out_buf.resize(output_length)             # <<<<<<<<<<<<<<
 *         return out_buf
 * 
 */
  /*else*/ {
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(6, 1553, __pyx_L1_error) }
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_buf), __pyx_n_s_resize); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_output_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/io.pxi":1554
 *     else:
 *         out_buf.resize(output_length)
 *         return out_buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(6, 1554, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_r = ((PyObject *)__pyx_v_out_buf);
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1557
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_167decompress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_166decompress[] = "decompress(buf, decompressed_size=None, codec=u'lz4', asbytes=False, memory_pool=None)\n\n    Decompress data from buffer-like object.\n\n    Parameters\n    ----------\n    buf : pyarrow.Buffer, bytes, or memoryview-compatible object\n    decompressed_size : int64_t, default None\n        If not specified, will be computed if the codec is able to determine\n        the uncompressed buffer size\n    codec : string, default 'lz4'\n        Compression codec.\n        Supported types: {'brotli, 'gzip', 'lz4', 'snappy', 'zstd'}\n    asbytes : boolean, default False\n        Return result as Python bytes object, otherwise Buffer\n    memory_pool : MemoryPool, default None\n        Memory pool to use for buffer allocations, if any\n\n    Returns\n    -------\n    uncompressed : pyarrow.Buffer or bytes (if asbytes=True)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_167decompress = {"decompress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_167decompress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_166decompress};
static PyObject *__pyx_pw_7pyarrow_3lib_167decompress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  PyObject *__pyx_v_decompressed_size = 0;
  PyObject *__pyx_v_codec = 0;
  PyObject *__pyx_v_asbytes = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decompress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,&__pyx_n_s_decompressed_size,&__pyx_n_s_codec,&__pyx_n_s_asbytes,&__pyx_n_s_memory_pool,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_n_u_lz4);

    /* "pyarrow/io.pxi":1558
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',
 *                asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Decompress data from buffer-like object.
 */
    values[3] = ((PyObject *)Py_False);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_decompressed_size);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asbytes);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decompress") < 0)) __PYX_ERR(6, 1557, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_buf = values[0];
    __pyx_v_decompressed_size = values[1];
    __pyx_v_codec = values[2];
    __pyx_v_asbytes = values[3];
    __pyx_v_memory_pool = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decompress", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1557, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_166decompress(__pyx_self, __pyx_v_buf, __pyx_v_decompressed_size, __pyx_v_codec, __pyx_v_asbytes, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1557
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_166decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_decompressed_size, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool) {
  enum  arrow::Compression::type __pyx_v_c_codec;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_compressor;
  std::shared_ptr< arrow::Buffer>  __pyx_v_owned_buf;
   arrow::Buffer *__pyx_v_c_buf;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_out_buf = 0;
  int64_t __pyx_v_output_size;
  uint8_t *__pyx_v_output_buffer;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  std::shared_ptr< arrow::Buffer>  __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int64_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("decompress", 0);

  /* "pyarrow/io.pxi":1581
 *     """
 *     cdef:
 *         CompressionType c_codec = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] compressor
 *         cdef shared_ptr[CBuffer] owned_buf
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1581, __pyx_L1_error)
  __pyx_v_c_codec = __pyx_t_1;

  /* "pyarrow/io.pxi":1587
 *         cdef Buffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1588
 * 
 *     with nogil:
 *         check_status(CCodec.Create(c_codec, &compressor))             # <<<<<<<<<<<<<<
 * 
 *     owned_buf = as_c_buffer(buf)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_c_codec, (&__pyx_v_compressor))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1588, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1587
 *         cdef Buffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1590
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     owned_buf = as_c_buffer(buf)             # <<<<<<<<<<<<<<
 *     c_buf = owned_buf.get()
 * 
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_as_c_buffer(__pyx_v_buf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1590, __pyx_L1_error)
  __pyx_v_owned_buf = __pyx_t_3;

  /* "pyarrow/io.pxi":1591
 * 
 *     owned_buf = as_c_buffer(buf)
 *     c_buf = owned_buf.get()             # <<<<<<<<<<<<<<
 * 
 *     if decompressed_size is None:
 */
  __pyx_v_c_buf = __pyx_v_owned_buf.get();

  /* "pyarrow/io.pxi":1593
 *     c_buf = owned_buf.get()
 * 
 *     if decompressed_size is None:             # <<<<<<<<<<<<<<
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))
 */
  __pyx_t_4 = (__pyx_v_decompressed_size == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":1595
 *     if decompressed_size is None:
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t output_size = decompressed_size
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Must_pass_decompressed_size_for, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_codec) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_codec);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/io.pxi":1594
 * 
 *     if decompressed_size is None:
 *         raise ValueError("Must pass decompressed_size for {0} codec"             # <<<<<<<<<<<<<<
 *                          .format(codec))
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(6, 1594, __pyx_L1_error)

    /* "pyarrow/io.pxi":1593
 *     c_buf = owned_buf.get()
 * 
 *     if decompressed_size is None:             # <<<<<<<<<<<<<<
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))
 */
  }

  /* "pyarrow/io.pxi":1597
 *                          .format(codec))
 * 
 *     cdef int64_t output_size = decompressed_size             # <<<<<<<<<<<<<<
 *     cdef uint8_t* output_buffer = NULL
 * 
 */
  __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_decompressed_size); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1597, __pyx_L1_error)
  __pyx_v_output_size = __pyx_t_9;

  /* "pyarrow/io.pxi":1598
 * 
 *     cdef int64_t output_size = decompressed_size
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1600
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 1600, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":1601
 * 
 *     if asbytes:
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)             # <<<<<<<<<<<<<<
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 *     else:
 */
    __pyx_t_7 = PyBytes_FromStringAndSize(NULL, __pyx_v_output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_pybuf = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyarrow/io.pxi":1602
 *     if asbytes:
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)             # <<<<<<<<<<<<<<
 *     else:
 *         out_buf = allocate_buffer(output_size, memory_pool=memory_pool)
 */
    __pyx_v_output_buffer = ((uint8_t *)PyBytes_AS_STRING(__pyx_v_pybuf));

    /* "pyarrow/io.pxi":1600
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 */
    goto __pyx_L7;
  }

  /* "pyarrow/io.pxi":1604
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 *     else:
 *         out_buf = allocate_buffer(output_size, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_output_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(6, 1604, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(6, 1604, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "pyarrow/io.pxi":1605
 *     else:
 *         out_buf = allocate_buffer(output_size, memory_pool=memory_pool)
 *         output_buffer = out_buf.buffer.get().mutable_data()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __pyx_v_output_buffer = __pyx_v_out_buf->buffer.get()->mutable_data();
  }
  __pyx_L7:;

  /* "pyarrow/io.pxi":1607
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Decompress(c_buf.size(), c_buf.data(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1608
 * 
 *     with nogil:
 *         check_status(compressor.get()             # <<<<<<<<<<<<<<
 *                      .Decompress(c_buf.size(), c_buf.data(),
 *                                  output_size, output_buffer))
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_compressor.get()->Decompress(__pyx_v_c_buf->size(), __pyx_v_c_buf->data(), __pyx_v_output_size, __pyx_v_output_buffer)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1608, __pyx_L9_error)
      }

      /* "pyarrow/io.pxi":1607
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Decompress(c_buf.size(), c_buf.data(),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L10;
        }
        __pyx_L9_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L10:;
      }
  }

  /* "pyarrow/io.pxi":1612
 *                                  output_size, output_buffer))
 * 
 *     return pybuf if asbytes else out_buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 1612, __pyx_L1_error)
  if (__pyx_t_5) {
    if (unlikely(!__pyx_v_pybuf)) { __Pyx_RaiseUnboundLocalError("pybuf"); __PYX_ERR(6, 1612, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_v_pybuf);
    __pyx_t_10 = __pyx_v_pybuf;
  } else {
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(6, 1612, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_t_10 = ((PyObject *)__pyx_v_out_buf);
  }
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1557
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out_buf);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1615
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_169input_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_168input_stream[] = "input_stream(source, compression=u'detect', buffer_size=None)\n\n    Create an Arrow input stream.\n\n    Parameters\n    ----------\n    source: str, Path, buffer, file-like object, ...\n        The source to open for reading\n    compression: str optional, default 'detect'\n        The compression algorithm to use for on-the-fly decompression.\n        If \"detect\" and source is a file path, then compression will be\n        chosen based on the file extension.\n        If None, no compression will be applied.\n        Otherwise, a well-known algorithm name must be supplied (e.g. \"gzip\")\n    buffer_size: int, default None\n        If None or 0, no buffering will happen.  Otherwise the size of the\n        temporary read buffer.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_169input_stream = {"input_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_169input_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_168input_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_169input_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_compression = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_compression,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_detect);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input_stream") < 0)) __PYX_ERR(6, 1615, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_compression = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("input_stream", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1615, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_168input_stream(__pyx_self, __pyx_v_source, __pyx_v_compression, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_168input_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("input_stream", 0);
  __Pyx_INCREF(__pyx_v_compression);

  /* "pyarrow/io.pxi":1635
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __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/io.pxi":1636
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         source_path = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1636, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1636, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1635
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }
    __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;

    /* "pyarrow/io.pxi":1637
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         source_path = None
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 1637, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1638
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         source_path = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_source_path, Py_None);
      __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_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1635
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __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_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/io.pxi":1640
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1641
 * 
 *     if isinstance(source, NativeFile):
 *         stream = source             # <<<<<<<<<<<<<<
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1641, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1640
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1642
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
  __pyx_t_9 = (__pyx_v_source_path != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1643
 *         stream = source
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')             # <<<<<<<<<<<<<<
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source_path);
    __Pyx_GIVEREF(__pyx_v_source_path);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_path);
    __Pyx_INCREF(__pyx_n_u_r);
    __Pyx_GIVEREF(__pyx_n_u_r);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_r);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1642
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1644
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); 
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L12_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1645
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))             # <<<<<<<<<<<<<<
 *     elif (hasattr(source, 'read') and
 *           hasattr(source, 'close') and
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1644
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1646
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1646, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1647
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and
 *           hasattr(source, 'close') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'r')
 */
  __pyx_t_10 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_close); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1647, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1648
 *     elif (hasattr(source, 'read') and
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'r')
 *     else:
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_closed); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1648, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  __pyx_t_9 = __pyx_t_10;
  __pyx_L14_bool_binop_done:;

  /* "pyarrow/io.pxi":1646
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  if (likely(__pyx_t_9)) {

    /* "pyarrow/io.pxi":1649
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'r')             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_r);
    __Pyx_GIVEREF(__pyx_n_u_r);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_r);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1646
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1651
 *         stream = PythonFile(source, 'r')
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1652
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"
 *                         .format(source.__class__))             # <<<<<<<<<<<<<<
 * 
 *     if compression == 'detect':
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pa_input_stream_called_with_inst, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1651
 *         stream = PythonFile(source, 'r')
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(6, 1651, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "pyarrow/io.pxi":1654
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         # detect for OSFile too
 *         compression = _detect_compression(source_path)
 */
  __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_compression, __pyx_n_u_detect, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(6, 1654, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1656
 *     if compression == 'detect':
 *         # detect for OSFile too
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     if buffer_size is not None and buffer_size != 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source_path);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_compression, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1654
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         # detect for OSFile too
 *         compression = _detect_compression(source_path)
 */
  }

  /* "pyarrow/io.pxi":1658
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 */
  __pyx_t_10 = (__pyx_v_buffer_size != Py_None);
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_buffer_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(6, 1658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = __pyx_t_8;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1659
 * 
 *     if buffer_size is not None and buffer_size != 0:
 *         stream = BufferedInputStream(stream, buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     if compression is not None:
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_buffer_size);
    __Pyx_GIVEREF(__pyx_v_buffer_size);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_buffer_size);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferedInputStream), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1658
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 */
  }

  /* "pyarrow/io.pxi":1661
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedInputStream(stream, compression)
 * 
 */
  __pyx_t_9 = (__pyx_v_compression != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1662
 * 
 *     if compression is not None:
 *         stream = CompressedInputStream(stream, compression)             # <<<<<<<<<<<<<<
 * 
 *     return stream
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_compression);
    __Pyx_GIVEREF(__pyx_v_compression);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_compression);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_CompressedInputStream), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1661
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedInputStream(stream, compression)
 * 
 */
  }

  /* "pyarrow/io.pxi":1664
 *         stream = CompressedInputStream(stream, compression)
 * 
 *     return stream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __pyx_r = ((PyObject *)__pyx_v_stream);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1615
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */

  /* 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_11);
  __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1667
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_171output_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_170output_stream[] = "output_stream(source, compression=u'detect', buffer_size=None)\n\n    Create an Arrow output stream.\n\n    Parameters\n    ----------\n    source: str, Path, buffer, file-like object, ...\n        The source to open for writing\n    compression: str optional, default 'detect'\n        The compression algorithm to use for on-the-fly compression.\n        If \"detect\" and source is a file path, then compression will be\n        chosen based on the file extension.\n        If None, no compression will be applied.\n        Otherwise, a well-known algorithm name must be supplied (e.g. \"gzip\")\n    buffer_size: int, default None\n        If None or 0, no buffering will happen.  Otherwise the size of the\n        temporary write buffer.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_171output_stream = {"output_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_171output_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_170output_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_171output_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_compression = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_compression,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_detect);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "output_stream") < 0)) __PYX_ERR(6, 1667, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_compression = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("output_stream", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1667, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_170output_stream(__pyx_self, __pyx_v_source, __pyx_v_compression, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_170output_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("output_stream", 0);
  __Pyx_INCREF(__pyx_v_compression);

  /* "pyarrow/io.pxi":1687
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __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/io.pxi":1688
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         source_path = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1688, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1688, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1687
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }
    __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;

    /* "pyarrow/io.pxi":1689
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         source_path = None
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 1689, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1690
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         source_path = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_source_path, Py_None);
      __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_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1687
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __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_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/io.pxi":1692
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1693
 * 
 *     if isinstance(source, NativeFile):
 *         stream = source             # <<<<<<<<<<<<<<
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1693, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1692
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1694
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
  __pyx_t_9 = (__pyx_v_source_path != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1695
 *         stream = source
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')             # <<<<<<<<<<<<<<
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source_path);
    __Pyx_GIVEREF(__pyx_v_source_path);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_path);
    __Pyx_INCREF(__pyx_n_u_w);
    __Pyx_GIVEREF(__pyx_n_u_w);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_w);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1694
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1696
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); 
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L12_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1697
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))             # <<<<<<<<<<<<<<
 *     elif (hasattr(source, 'write') and
 *           hasattr(source, 'close') and
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1696
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1698
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_write); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1698, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1699
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and
 *           hasattr(source, 'close') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'w')
 */
  __pyx_t_10 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_close); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1699, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1700
 *     elif (hasattr(source, 'write') and
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'w')
 *     else:
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_closed); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1700, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  __pyx_t_9 = __pyx_t_10;
  __pyx_L14_bool_binop_done:;

  /* "pyarrow/io.pxi":1698
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  if (likely(__pyx_t_9)) {

    /* "pyarrow/io.pxi":1701
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'w')             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_w);
    __Pyx_GIVEREF(__pyx_n_u_w);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_w);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1698
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1703
 *         stream = PythonFile(source, 'w')
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1704
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"
 *                         .format(source.__class__))             # <<<<<<<<<<<<<<
 * 
 *     if compression == 'detect':
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pa_output_stream_called_with_ins, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1703
 *         stream = PythonFile(source, 'w')
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(6, 1703, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "pyarrow/io.pxi":1706
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_compression, __pyx_n_u_detect, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(6, 1706, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1707
 * 
 *     if compression == 'detect':
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     if buffer_size is not None and buffer_size != 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source_path);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_compression, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1706
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  }

  /* "pyarrow/io.pxi":1709
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 */
  __pyx_t_10 = (__pyx_v_buffer_size != Py_None);
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_buffer_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(6, 1709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = __pyx_t_8;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1710
 * 
 *     if buffer_size is not None and buffer_size != 0:
 *         stream = BufferedOutputStream(stream, buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     if compression is not None:
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_buffer_size);
    __Pyx_GIVEREF(__pyx_v_buffer_size);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_buffer_size);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferedOutputStream), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1709
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 */
  }

  /* "pyarrow/io.pxi":1712
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedOutputStream(stream, compression)
 * 
 */
  __pyx_t_9 = (__pyx_v_compression != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1713
 * 
 *     if compression is not None:
 *         stream = CompressedOutputStream(stream, compression)             # <<<<<<<<<<<<<<
 * 
 *     return stream
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_compression);
    __Pyx_GIVEREF(__pyx_v_compression);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_compression);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_CompressedOutputStream), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1712
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedOutputStream(stream, compression)
 * 
 */
  }

  /* "pyarrow/io.pxi":1715
 *         stream = CompressedOutputStream(stream, compression)
 * 
 *     return stream             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __pyx_r = ((PyObject *)__pyx_v_stream);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1667
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */

  /* 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_11);
  __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_173have_libhdfs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_172have_libhdfs[] = "have_libhdfs()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_173have_libhdfs = {"have_libhdfs", (PyCFunction)__pyx_pw_7pyarrow_3lib_173have_libhdfs, METH_NOARGS, __pyx_doc_7pyarrow_3lib_172have_libhdfs};
static PyObject *__pyx_pw_7pyarrow_3lib_173have_libhdfs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("have_libhdfs (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_172have_libhdfs(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_172have_libhdfs(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("have_libhdfs", 0);

  /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
  {
    __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/io-hdfs.pxi":32
 * def have_libhdfs():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs())
 *         return True
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io-hdfs.pxi":33
 *     try:
 *         with nogil:
 *             check_status(HaveLibHdfs())             # <<<<<<<<<<<<<<
 *         return True
 *     except Exception:
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 33, __pyx_L10_error)
          }

          /* "pyarrow/io-hdfs.pxi":32
 * def have_libhdfs():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs())
 *         return True
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L3_error;
            }
            __pyx_L11:;
          }
      }

      /* "pyarrow/io-hdfs.pxi":34
 *         with nogil:
 *             check_status(HaveLibHdfs())
 *         return True             # <<<<<<<<<<<<<<
 *     except Exception:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
    }
    __pyx_L3_error:;

    /* "pyarrow/io-hdfs.pxi":35
 *             check_status(HaveLibHdfs())
 *         return True
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("pyarrow.lib.have_libhdfs", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 35, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/io-hdfs.pxi":36
 *         return True
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __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;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.have_libhdfs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_175have_libhdfs3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_174have_libhdfs3[] = "have_libhdfs3()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_175have_libhdfs3 = {"have_libhdfs3", (PyCFunction)__pyx_pw_7pyarrow_3lib_175have_libhdfs3, METH_NOARGS, __pyx_doc_7pyarrow_3lib_174have_libhdfs3};
static PyObject *__pyx_pw_7pyarrow_3lib_175have_libhdfs3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("have_libhdfs3 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_174have_libhdfs3(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_174have_libhdfs3(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("have_libhdfs3", 0);

  /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
  {
    __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/io-hdfs.pxi":41
 * def have_libhdfs3():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs3())
 *         return True
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io-hdfs.pxi":42
 *     try:
 *         with nogil:
 *             check_status(HaveLibHdfs3())             # <<<<<<<<<<<<<<
 *         return True
 *     except Exception:
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs3()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 42, __pyx_L10_error)
          }

          /* "pyarrow/io-hdfs.pxi":41
 * def have_libhdfs3():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs3())
 *         return True
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L3_error;
            }
            __pyx_L11:;
          }
      }

      /* "pyarrow/io-hdfs.pxi":43
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 *         return True             # <<<<<<<<<<<<<<
 *     except Exception:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
    }
    __pyx_L3_error:;

    /* "pyarrow/io-hdfs.pxi":44
 *             check_status(HaveLibHdfs3())
 *         return True
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("pyarrow.lib.have_libhdfs3", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 44, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/io-hdfs.pxi":45
 *         return True
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __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;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.have_libhdfs3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_177strip_hdfs_abspath(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_176strip_hdfs_abspath[] = "strip_hdfs_abspath(path)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_177strip_hdfs_abspath = {"strip_hdfs_abspath", (PyCFunction)__pyx_pw_7pyarrow_3lib_177strip_hdfs_abspath, METH_O, __pyx_doc_7pyarrow_3lib_176strip_hdfs_abspath};
static PyObject *__pyx_pw_7pyarrow_3lib_177strip_hdfs_abspath(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("strip_hdfs_abspath (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_176strip_hdfs_abspath(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_176strip_hdfs_abspath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  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;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("strip_hdfs_abspath", 0);

  /* "pyarrow/io-hdfs.pxi":49
 * 
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)             # <<<<<<<<<<<<<<
 *     if m:
 *         return m.group(3)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HDFS_PATH_RE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":50
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:             # <<<<<<<<<<<<<<
 *         return m.group(3)
 *     else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 50, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io-hdfs.pxi":51
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 *         return m.group(3)             # <<<<<<<<<<<<<<
 *     else:
 *         return path
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/io-hdfs.pxi":50
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:             # <<<<<<<<<<<<<<
 *         return m.group(3)
 *     else:
 */
  }

  /* "pyarrow/io-hdfs.pxi":53
 *         return m.group(3)
 *     else:
 *         return path             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_path);
    __pyx_r = __pyx_v_path;
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.strip_hdfs_abspath", __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/io-hdfs.pxi":69
 *         dict extra_conf
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):             # <<<<<<<<<<<<<<
 *         cdef HdfsConnectionConfig conf
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem__connect[] = "HadoopFileSystem._connect(self, host, port, user, kerb_ticket, driver, extra_conf)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_user = 0;
  PyObject *__pyx_v_kerb_ticket = 0;
  PyObject *__pyx_v_driver = 0;
  PyObject *__pyx_v_extra_conf = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_connect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_user,&__pyx_n_s_kerb_ticket,&__pyx_n_s_driver,&__pyx_n_s_extra_conf,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 1); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 2); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kerb_ticket)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 3); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_driver)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 4); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra_conf)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 5); __PYX_ERR(2, 69, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_connect") < 0)) __PYX_ERR(2, 69, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_host = values[0];
    __pyx_v_port = values[1];
    __pyx_v_user = values[2];
    __pyx_v_kerb_ticket = values[3];
    __pyx_v_driver = values[4];
    __pyx_v_extra_conf = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 69, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_user, __pyx_v_kerb_ticket, __pyx_v_driver, __pyx_v_extra_conf);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_user, PyObject *__pyx_v_kerb_ticket, PyObject *__pyx_v_driver, PyObject *__pyx_v_extra_conf) {
  arrow::io::HdfsConnectionConfig __pyx_v_conf;
  PyObject *__pyx_9genexpr17__pyx_v_k = NULL;
  PyObject *__pyx_9genexpr17__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  std::unordered_map<std::string,std::string>  __pyx_t_15;
  __Pyx_RefNannySetupContext("_connect", 0);

  /* "pyarrow/io-hdfs.pxi":72
 *         cdef HdfsConnectionConfig conf
 * 
 *         if host is not None:             # <<<<<<<<<<<<<<
 *             conf.host = tobytes(host)
 *         self.host = host
 */
  __pyx_t_1 = (__pyx_v_host != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":73
 * 
 *         if host is not None:
 *             conf.host = tobytes(host)             # <<<<<<<<<<<<<<
 *         self.host = host
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_host) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_host);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.host = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":72
 *         cdef HdfsConnectionConfig conf
 * 
 *         if host is not None:             # <<<<<<<<<<<<<<
 *             conf.host = tobytes(host)
 *         self.host = host
 */
  }

  /* "pyarrow/io-hdfs.pxi":74
 *         if host is not None:
 *             conf.host = tobytes(host)
 *         self.host = host             # <<<<<<<<<<<<<<
 * 
 *         conf.port = port
 */
  __Pyx_INCREF(__pyx_v_host);
  __Pyx_GIVEREF(__pyx_v_host);
  __Pyx_GOTREF(__pyx_v_self->host);
  __Pyx_DECREF(__pyx_v_self->host);
  __pyx_v_self->host = __pyx_v_host;

  /* "pyarrow/io-hdfs.pxi":76
 *         self.host = host
 * 
 *         conf.port = port             # <<<<<<<<<<<<<<
 *         self.port = port
 * 
 */
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_port); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 76, __pyx_L1_error)
  __pyx_v_conf.port = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":77
 * 
 *         conf.port = port
 *         self.port = port             # <<<<<<<<<<<<<<
 * 
 *         if user is not None:
 */
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_port); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 77, __pyx_L1_error)
  __pyx_v_self->port = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":79
 *         self.port = port
 * 
 *         if user is not None:             # <<<<<<<<<<<<<<
 *             conf.user = tobytes(user)
 *         self.user = user
 */
  __pyx_t_2 = (__pyx_v_user != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io-hdfs.pxi":80
 * 
 *         if user is not None:
 *             conf.user = tobytes(user)             # <<<<<<<<<<<<<<
 *         self.user = user
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_user) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_user);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.user = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":79
 *         self.port = port
 * 
 *         if user is not None:             # <<<<<<<<<<<<<<
 *             conf.user = tobytes(user)
 *         self.user = user
 */
  }

  /* "pyarrow/io-hdfs.pxi":81
 *         if user is not None:
 *             conf.user = tobytes(user)
 *         self.user = user             # <<<<<<<<<<<<<<
 * 
 *         if kerb_ticket is not None:
 */
  __Pyx_INCREF(__pyx_v_user);
  __Pyx_GIVEREF(__pyx_v_user);
  __Pyx_GOTREF(__pyx_v_self->user);
  __Pyx_DECREF(__pyx_v_self->user);
  __pyx_v_self->user = __pyx_v_user;

  /* "pyarrow/io-hdfs.pxi":83
 *         self.user = user
 * 
 *         if kerb_ticket is not None:             # <<<<<<<<<<<<<<
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket
 */
  __pyx_t_1 = (__pyx_v_kerb_ticket != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":84
 * 
 *         if kerb_ticket is not None:
 *             conf.kerb_ticket = tobytes(kerb_ticket)             # <<<<<<<<<<<<<<
 *         self.kerb_ticket = kerb_ticket
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_kerb_ticket) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_kerb_ticket);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.kerb_ticket = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":83
 *         self.user = user
 * 
 *         if kerb_ticket is not None:             # <<<<<<<<<<<<<<
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket
 */
  }

  /* "pyarrow/io-hdfs.pxi":85
 *         if kerb_ticket is not None:
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket             # <<<<<<<<<<<<<<
 * 
 *         if driver == 'libhdfs':
 */
  __Pyx_INCREF(__pyx_v_kerb_ticket);
  __Pyx_GIVEREF(__pyx_v_kerb_ticket);
  __Pyx_GOTREF(__pyx_v_self->kerb_ticket);
  __Pyx_DECREF(__pyx_v_self->kerb_ticket);
  __pyx_v_self->kerb_ticket = __pyx_v_kerb_ticket;

  /* "pyarrow/io-hdfs.pxi":87
 *         self.kerb_ticket = kerb_ticket
 * 
 *         if driver == 'libhdfs':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_driver, __pyx_n_u_libhdfs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 87, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":88
 * 
 *         if driver == 'libhdfs':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":89
 *         if driver == 'libhdfs':
 *             with nogil:
 *                 check_status(HaveLibHdfs())             # <<<<<<<<<<<<<<
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs()); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 89, __pyx_L8_error)
        }

        /* "pyarrow/io-hdfs.pxi":88
 * 
 *         if driver == 'libhdfs':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":90
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS             # <<<<<<<<<<<<<<
 *         elif driver == 'libhdfs3':
 *             with nogil:
 */
    __pyx_v_conf.driver =  arrow::io::HdfsDriver::LIBHDFS;

    /* "pyarrow/io-hdfs.pxi":87
 *         self.kerb_ticket = kerb_ticket
 * 
 *         if driver == 'libhdfs':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io-hdfs.pxi":91
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_driver, __pyx_n_u_libhdfs3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 91, __pyx_L1_error)
  if (likely(__pyx_t_2)) {

    /* "pyarrow/io-hdfs.pxi":92
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":93
 *         elif driver == 'libhdfs3':
 *             with nogil:
 *                 check_status(HaveLibHdfs3())             # <<<<<<<<<<<<<<
 *             conf.driver = HdfsDriver_LIBHDFS3
 *         else:
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs3()); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 93, __pyx_L11_error)
        }

        /* "pyarrow/io-hdfs.pxi":92
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L12;
          }
          __pyx_L11_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L12:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":94
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)
 */
    __pyx_v_conf.driver =  arrow::io::HdfsDriver::LIBHDFS3;

    /* "pyarrow/io-hdfs.pxi":91
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io-hdfs.pxi":96
 *             conf.driver = HdfsDriver_LIBHDFS3
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)             # <<<<<<<<<<<<<<
 *         self.driver = driver
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_driver_r, __pyx_v_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(2, 96, __pyx_L1_error)
  }
  __pyx_L6:;

  /* "pyarrow/io-hdfs.pxi":97
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)
 *         self.driver = driver             # <<<<<<<<<<<<<<
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 */
  __Pyx_INCREF(__pyx_v_driver);
  __Pyx_GIVEREF(__pyx_v_driver);
  __Pyx_GOTREF(__pyx_v_self->driver);
  __Pyx_DECREF(__pyx_v_self->driver);
  __pyx_v_self->driver = __pyx_v_driver;

  /* "pyarrow/io-hdfs.pxi":99
 *         self.driver = driver
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):             # <<<<<<<<<<<<<<
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 */
  __pyx_t_1 = (__pyx_v_extra_conf != Py_None);
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_2 = __pyx_t_8;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_8 = PyDict_Check(__pyx_v_extra_conf); 
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":100
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)             # <<<<<<<<<<<<<<
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf
 */
    { /* enter inner scope */
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 100, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":101
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}             # <<<<<<<<<<<<<<
 *         self.extra_conf = extra_conf
 * 
 */
      __pyx_t_9 = 0;
      if (unlikely(__pyx_v_extra_conf == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
        __PYX_ERR(2, 101, __pyx_L18_error)
      }
      __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_extra_conf, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 101, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
      while (1) {
        __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_10, &__pyx_t_9, &__pyx_t_5, &__pyx_t_11, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_12 == 0)) break;
        if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(2, 101, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_k, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_v, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "pyarrow/io-hdfs.pxi":100
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)             # <<<<<<<<<<<<<<
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_13, __pyx_9genexpr17__pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr17__pyx_v_k);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_9genexpr17__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_9genexpr17__pyx_v_v);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_11, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_k); __pyx_9genexpr17__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_v); __pyx_9genexpr17__pyx_v_v = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_k); __pyx_9genexpr17__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_v); __pyx_9genexpr17__pyx_v_v = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    __pyx_t_15 = __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_conf.extra_conf = __pyx_t_15;

    /* "pyarrow/io-hdfs.pxi":99
 *         self.driver = driver
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):             # <<<<<<<<<<<<<<
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 */
  }

  /* "pyarrow/io-hdfs.pxi":102
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_extra_conf))||((__pyx_v_extra_conf) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_extra_conf)->tp_name), 0))) __PYX_ERR(2, 102, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_extra_conf;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->extra_conf);
  __Pyx_DECREF(__pyx_v_self->extra_conf);
  __pyx_v_self->extra_conf = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/io-hdfs.pxi":104
 *         self.extra_conf = extra_conf
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CHadoopFileSystem.Connect(&conf, &self.client))
 *         self.is_open = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":105
 * 
 *         with nogil:
 *             check_status(CHadoopFileSystem.Connect(&conf, &self.client))             # <<<<<<<<<<<<<<
 *         self.is_open = True
 * 
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::HadoopFileSystem::Connect((&__pyx_v_conf), (&__pyx_v_self->client))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 105, __pyx_L23_error)
      }

      /* "pyarrow/io-hdfs.pxi":104
 *         self.extra_conf = extra_conf
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CHadoopFileSystem.Connect(&conf, &self.client))
 *         self.is_open = True
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L24;
        }
        __pyx_L23_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L24:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":106
 *         with nogil:
 *             check_status(CHadoopFileSystem.Connect(&conf, &self.client))
 *         self.is_open = True             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_v_self->is_open = 1;

  /* "pyarrow/io-hdfs.pxi":69
 *         dict extra_conf
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):             # <<<<<<<<<<<<<<
 *         cdef HdfsConnectionConfig conf
 * 
 */

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_k);
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_2connect[] = "HadoopFileSystem.connect(type cls, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "connect", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "pyarrow/io-hdfs.pxi":110
 *     @classmethod
 *     def connect(cls, *args, **kwargs):
 *         return cls(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":112
 *         return cls(*args, **kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.is_open:
 *             self.close()
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":113
 * 
 *     def __dealloc__(self):
 *         if self.is_open:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_1 = (__pyx_v_self->is_open != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io-hdfs.pxi":114
 *     def __dealloc__(self):
 *         if self.is_open:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io-hdfs.pxi":113
 * 
 *     def __dealloc__(self):
 *         if self.is_open:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":112
 *         return cls(*args, **kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.is_open:
 *             self.close()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyarrow.lib.HadoopFileSystem.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io-hdfs.pxi":116
 *             self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disconnect from the HDFS cluster
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_6close[] = "HadoopFileSystem.close(self)\n\n        Disconnect from the HDFS cluster\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/io-hdfs.pxi":120
 *         Disconnect from the HDFS cluster
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().Disconnect())
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":121
 *         """
 *         self._ensure_client()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":122
 *         self._ensure_client()
 *         with nogil:
 *             check_status(self.client.get().Disconnect())             # <<<<<<<<<<<<<<
 *         self.is_open = False
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Disconnect()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 122, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":121
 *         """
 *         self._ensure_client()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":123
 *         with nogil:
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False             # <<<<<<<<<<<<<<
 * 
 *     cdef _ensure_client(self):
 */
  __pyx_v_self->is_open = 0;

  /* "pyarrow/io-hdfs.pxi":116
 *             self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disconnect from the HDFS cluster
 */

  /* 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.lib.HadoopFileSystem.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":125
 *         self.is_open = False
 * 
 *     cdef _ensure_client(self):             # <<<<<<<<<<<<<<
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 */

static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_ensure_client", 0);

  /* "pyarrow/io-hdfs.pxi":126
 * 
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 */
  __pyx_t_1 = ((__pyx_v_self->client.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io-hdfs.pxi":127
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')             # <<<<<<<<<<<<<<
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 127, __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(2, 127, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":126
 * 
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 */
  }

  /* "pyarrow/io-hdfs.pxi":128
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client is closed')
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io-hdfs.pxi":129
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')             # <<<<<<<<<<<<<<
 * 
 *     def exists(self, path):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 129, __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(2, 129, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":128
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client is closed')
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":125
 *         self.is_open = False
 * 
 *     cdef _ensure_client(self):             # <<<<<<<<<<<<<<
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 */

  /* 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.lib.HadoopFileSystem._ensure_client", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":131
 *             raise IOError('HDFS client is closed')
 * 
 *     def exists(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the path is known to the cluster, False if it does not
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_8exists[] = "HadoopFileSystem.exists(self, path)\n\n        Returns True if the path is known to the cluster, False if it does not\n        (or there is an RPC error)\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exists (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  std::string __pyx_v_c_path;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __Pyx_RefNannySetupContext("exists", 0);

  /* "pyarrow/io-hdfs.pxi":136
 *         (or there is an RPC error)
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":138
 *         self._ensure_client()
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_bool result
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":140
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().Exists(c_path)
 *         return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":141
 *         cdef c_bool result
 *         with nogil:
 *             result = self.client.get().Exists(c_path)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        __pyx_v_result = __pyx_v_self->client.get()->Exists(__pyx_v_c_path);
      }

      /* "pyarrow/io-hdfs.pxi":140
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().Exists(c_path)
 *         return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":142
 *         with nogil:
 *             result = self.client.get().Exists(c_path)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def isdir(self, path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":131
 *             raise IOError('HDFS client is closed')
 * 
 *     def exists(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the path is known to the cluster, False if it does not
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":144
 *         return result
 * 
 *     def isdir(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_10isdir[] = "HadoopFileSystem.isdir(self, path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isdir (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  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;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("isdir", 0);

  /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
  {
    __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/io-hdfs.pxi":147
 *         cdef HdfsPathInfo info
 *         try:
 *             self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         except ArrowIOError:
 *             return False
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 147, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    }
    __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;

    /* "pyarrow/io-hdfs.pxi":148
 *         try:
 *             self._path_info(path, &info)
 *         except ArrowIOError:             # <<<<<<<<<<<<<<
 *             return False
 *         return info.kind == ObjectType_DIRECTORY
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 148, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(2, 148, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":149
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 *             return False             # <<<<<<<<<<<<<<
 *         return info.kind == ObjectType_DIRECTORY
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    __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/io-hdfs.pxi":150
 *         except ArrowIOError:
 *             return False
 *         return info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 * 
 *     def isfile(self, path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":144
 *         return result
 * 
 *     def isdir(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":152
 *         return info.kind == ObjectType_DIRECTORY
 * 
 *     def isfile(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_12isfile[] = "HadoopFileSystem.isfile(self, path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isfile (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  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;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("isfile", 0);

  /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
  {
    __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/io-hdfs.pxi":155
 *         cdef HdfsPathInfo info
 *         try:
 *             self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         except ArrowIOError:
 *             return False
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 155, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    }
    __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;

    /* "pyarrow/io-hdfs.pxi":156
 *         try:
 *             self._path_info(path, &info)
 *         except ArrowIOError:             # <<<<<<<<<<<<<<
 *             return False
 *         return info.kind == ObjectType_FILE
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 156, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(2, 156, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":157
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 *             return False             # <<<<<<<<<<<<<<
 *         return info.kind == ObjectType_FILE
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    __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/io-hdfs.pxi":158
 *         except ArrowIOError:
 *             return False
 *         return info.kind == ObjectType_FILE             # <<<<<<<<<<<<<<
 * 
 *     def get_capacity(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_info.kind ==  arrow::io::ObjectType::FILE)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":152
 *         return info.kind == ObjectType_DIRECTORY
 * 
 *     def isfile(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":160
 *         return info.kind == ObjectType_FILE
 * 
 *     def get_capacity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get reported total capacity of file system
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_14get_capacity[] = "HadoopFileSystem.get_capacity(self)\n\n        Get reported total capacity of file system\n\n        Returns\n        -------\n        capacity : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  int64_t __pyx_v_capacity;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_capacity", 0);

  /* "pyarrow/io-hdfs.pxi":168
 *         capacity : int
 *         """
 *         cdef int64_t capacity = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))
 */
  __pyx_v_capacity = 0;

  /* "pyarrow/io-hdfs.pxi":169
 *         """
 *         cdef int64_t capacity = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":170
 *         cdef int64_t capacity = 0
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))             # <<<<<<<<<<<<<<
 *         return capacity
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetCapacity((&__pyx_v_capacity))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 170, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":169
 *         """
 *         cdef int64_t capacity = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":171
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity             # <<<<<<<<<<<<<<
 * 
 *     def get_space_used(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":160
 *         return info.kind == ObjectType_FILE
 * 
 *     def get_capacity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get reported total capacity of file system
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.get_capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":173
 *         return capacity
 * 
 *     def get_space_used(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get space used on file system
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_16get_space_used[] = "HadoopFileSystem.get_space_used(self)\n\n        Get space used on file system\n\n        Returns\n        -------\n        space_used : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_space_used (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  int64_t __pyx_v_space_used;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_space_used", 0);

  /* "pyarrow/io-hdfs.pxi":181
 *         space_used : int
 *         """
 *         cdef int64_t space_used = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))
 */
  __pyx_v_space_used = 0;

  /* "pyarrow/io-hdfs.pxi":182
 *         """
 *         cdef int64_t space_used = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":183
 *         cdef int64_t space_used = 0
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))             # <<<<<<<<<<<<<<
 *         return space_used
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetUsed((&__pyx_v_space_used))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 183, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":182
 *         """
 *         cdef int64_t space_used = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":184
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used             # <<<<<<<<<<<<<<
 * 
 *     def df(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_space_used); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":173
 *         return capacity
 * 
 *     def get_space_used(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get space used on file system
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.get_space_used", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":186
 *         return space_used
 * 
 *     def df(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return free space on disk, like the UNIX df command
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_18df[] = "HadoopFileSystem.df(self)\n\n        Return free space on disk, like the UNIX df command\n\n        Returns\n        -------\n        space : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("df (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__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;
  __Pyx_RefNannySetupContext("df", 0);

  /* "pyarrow/io-hdfs.pxi":194
 *         space : int
 *         """
 *         return self.get_capacity() - self.get_space_used()             # <<<<<<<<<<<<<<
 * 
 *     def rename(self, path, new_path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_space_used); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":186
 *         return space_used
 * 
 *     def df(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return free space on disk, like the UNIX df 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.lib.HadoopFileSystem.df", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":196
 *         return self.get_capacity() - self.get_space_used()
 * 
 *     def rename(self, path, new_path):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_20rename[] = "HadoopFileSystem.rename(self, path, new_path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_new_path = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rename (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_new_path,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_path)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(2, 196, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(2, 196, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_new_path = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 196, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_new_path);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_new_path) {
  std::string __pyx_v_c_path;
  std::string __pyx_v_c_new_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("rename", 0);

  /* "pyarrow/io-hdfs.pxi":197
 * 
 *     def rename(self, path, new_path):
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":198
 *     def rename(self, path, new_path):
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_new_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_new_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_new_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":199
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":200
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:
 *             check_status(self.client.get().Rename(c_path, c_new_path))             # <<<<<<<<<<<<<<
 * 
 *     def info(self, path):
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Rename(__pyx_v_c_path, __pyx_v_c_new_path)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 200, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":199
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":196
 *         return self.get_capacity() - self.get_space_used()
 * 
 *     def rename(self, path, new_path):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 */

  /* 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.lib.HadoopFileSystem.rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":202
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 *     def info(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return detailed HDFS information for path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_22info[] = "HadoopFileSystem.info(self, path)\n\n        Return detailed HDFS information for path\n\n        Parameters\n        ----------\n        path : string\n            Path to file or directory\n\n        Returns\n        -------\n        path_info : dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("info (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("info", 0);

  /* "pyarrow/io-hdfs.pxi":216
 *         """
 *         cdef HdfsPathInfo info
 *         self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         return {
 *             'path': frombytes(info.name),
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":217
 *         cdef HdfsPathInfo info
 *         self._path_info(path, &info)
 *         return {             # <<<<<<<<<<<<<<
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io-hdfs.pxi":218
 *         self._path_info(path, &info)
 *         return {
 *             'path': frombytes(info.name),             # <<<<<<<<<<<<<<
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_path, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":219
 *         return {
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),             # <<<<<<<<<<<<<<
 *             'group': frombytes(info.group),
 *             'size': info.size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.owner); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_owner, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":220
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),             # <<<<<<<<<<<<<<
 *             'size': info.size,
 *             'block_size': info.block_size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.group); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_group, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":221
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),
 *             'size': info.size,             # <<<<<<<<<<<<<<
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":222
 *             'group': frombytes(info.group),
 *             'size': info.size,
 *             'block_size': info.block_size,             # <<<<<<<<<<<<<<
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_block_size, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":223
 *             'size': info.size,
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,             # <<<<<<<<<<<<<<
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info.last_modified_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_modified, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":224
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,             # <<<<<<<<<<<<<<
 *             'replication': info.replication,
 *             'permissions': info.permissions,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info.last_access_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_accessed, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":225
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,             # <<<<<<<<<<<<<<
 *             'permissions': info.permissions,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 */
  __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info.replication); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_replication, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":226
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,
 *             'permissions': info.permissions,             # <<<<<<<<<<<<<<
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 *                      else 'file')
 */
  __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info.permissions); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_permissions, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":227
 *             'replication': info.replication,
 *             'permissions': info.permissions,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 *                      else 'file')
 *         }
 */
  if (((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY) != 0)) {
    __Pyx_INCREF(__pyx_n_u_directory);
    __pyx_t_2 = __pyx_n_u_directory;
  } else {
    __Pyx_INCREF(__pyx_n_u_file);
    __pyx_t_2 = __pyx_n_u_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":202
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 *     def info(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return detailed HDFS information for path
 */

  /* 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.lib.HadoopFileSystem.info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":231
 *         }
 * 
 *     def stat(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return basic file system statistics about path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_24stat[] = "HadoopFileSystem.stat(self, path)\n\n        Return basic file system statistics about path\n\n        Parameters\n        ----------\n        path : string\n            Path to file or directory\n\n        Returns\n        -------\n        stat : dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stat (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::FileStatistics __pyx_v_info;
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("stat", 0);

  /* "pyarrow/io-hdfs.pxi":245
 *         """
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":246
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":247
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Stat(c_path, &info))
 *         return {
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Stat(__pyx_v_c_path, (&__pyx_v_info))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 247, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":246
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":249
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 *         return {             # <<<<<<<<<<<<<<
 *             'size': info.size,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io-hdfs.pxi":250
 *                          .Stat(c_path, &info))
 *         return {
 *             'size': info.size,             # <<<<<<<<<<<<<<
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 *                      else 'file')
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":251
 *         return {
 *             'size': info.size,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 *                      else 'file')
 *         }
 */
  if (((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY) != 0)) {
    __Pyx_INCREF(__pyx_n_u_directory);
    __pyx_t_2 = __pyx_n_u_directory;
  } else {
    __Pyx_INCREF(__pyx_n_u_file);
    __pyx_t_2 = __pyx_n_u_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_t_2) < 0) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":231
 *         }
 * 
 *     def stat(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return basic file system statistics about path
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":255
 *         }
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, arrow::io::HdfsPathInfo *__pyx_v_info) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_path_info", 0);

  /* "pyarrow/io-hdfs.pxi":256
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":258
 *         cdef c_string c_path = tobytes(path)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .GetPathInfo(c_path, info))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":259
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .GetPathInfo(c_path, info))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetPathInfo(__pyx_v_c_path, __pyx_v_info)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 259, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":258
 *         cdef c_string c_path = tobytes(path)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .GetPathInfo(c_path, info))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":255
 *         }
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 * 
 */

  /* 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.lib.HadoopFileSystem._path_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":262
 *                          .GetPathInfo(c_path, info))
 * 
 *     def ls(self, path, bint full_info):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string c_path = tobytes(path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_26ls[] = "HadoopFileSystem.ls(self, path, bool full_info)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  int __pyx_v_full_info;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ls (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_full_info,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ls", 1, 2, 2, 1); __PYX_ERR(2, 262, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ls") < 0)) __PYX_ERR(2, 262, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_full_info = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_full_info == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 262, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ls", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 262, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.ls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_full_info);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_full_info) {
  std::string __pyx_v_c_path;
  std::vector<arrow::io::HdfsPathInfo>  __pyx_v_listing;
  PyObject *__pyx_v_results = 0;
  int __pyx_v_i;
  arrow::io::HdfsPathInfo const *__pyx_v_info;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_kind = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("ls", 0);

  /* "pyarrow/io-hdfs.pxi":264
 *     def ls(self, path, bint full_info):
 *         cdef:
 *             c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *             vector[HdfsPathInfo] listing
 *             list results = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":266
 *             c_string c_path = tobytes(path)
 *             vector[HdfsPathInfo] listing
 *             list results = []             # <<<<<<<<<<<<<<
 *             int i
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_results = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":269
 *             int i
 * 
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":271
 *         self._ensure_client()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .ListDirectory(c_path, &listing))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":272
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .ListDirectory(c_path, &listing))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->ListDirectory(__pyx_v_c_path, (&__pyx_v_listing))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 272, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":271
 *         self._ensure_client()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .ListDirectory(c_path, &listing))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":276
 * 
 *         cdef const HdfsPathInfo* info
 *         for i in range(<int> listing.size()):             # <<<<<<<<<<<<<<
 *             info = &listing[i]
 * 
 */
  __pyx_t_5 = ((int)__pyx_v_listing.size());
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyarrow/io-hdfs.pxi":277
 *         cdef const HdfsPathInfo* info
 *         for i in range(<int> listing.size()):
 *             info = &listing[i]             # <<<<<<<<<<<<<<
 * 
 *             # Try to trim off the hdfs://HOST:PORT piece
 */
    __pyx_v_info = (&(__pyx_v_listing[__pyx_v_i]));

    /* "pyarrow/io-hdfs.pxi":280
 * 
 *             # Try to trim off the hdfs://HOST:PORT piece
 *             name = strip_hdfs_abspath(frombytes(info.name))             # <<<<<<<<<<<<<<
 * 
 *             if full_info:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_strip_hdfs_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->name); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":282
 *             name = strip_hdfs_abspath(frombytes(info.name))
 * 
 *             if full_info:             # <<<<<<<<<<<<<<
 *                 kind = ('file' if info.kind == ObjectType_FILE
 *                         else 'directory')
 */
    __pyx_t_11 = (__pyx_v_full_info != 0);
    if (__pyx_t_11) {

      /* "pyarrow/io-hdfs.pxi":283
 * 
 *             if full_info:
 *                 kind = ('file' if info.kind == ObjectType_FILE             # <<<<<<<<<<<<<<
 *                         else 'directory')
 * 
 */
      if (((__pyx_v_info->kind ==  arrow::io::ObjectType::FILE) != 0)) {
        __Pyx_INCREF(__pyx_n_u_file);
        __pyx_t_1 = __pyx_n_u_file;
      } else {
        __Pyx_INCREF(__pyx_n_u_directory);
        __pyx_t_1 = __pyx_n_u_directory;
      }
      __Pyx_XDECREF_SET(__pyx_v_kind, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pyarrow/io-hdfs.pxi":287
 * 
 *                 results.append({
 *                     'kind': kind,             # <<<<<<<<<<<<<<
 *                     'name': name,
 *                     'owner': frombytes(info.owner),
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_v_kind) < 0) __PYX_ERR(2, 287, __pyx_L1_error)

      /* "pyarrow/io-hdfs.pxi":288
 *                 results.append({
 *                     'kind': kind,
 *                     'name': name,             # <<<<<<<<<<<<<<
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),
 */
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_name, __pyx_v_name) < 0) __PYX_ERR(2, 287, __pyx_L1_error)

      /* "pyarrow/io-hdfs.pxi":289
 *                     'kind': kind,
 *                     'name': name,
 *                     'owner': frombytes(info.owner),             # <<<<<<<<<<<<<<
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->owner); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_owner, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":290
 *                     'name': name,
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),             # <<<<<<<<<<<<<<
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->group); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_group, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":291
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,             # <<<<<<<<<<<<<<
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info->last_modified_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_modified_time, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":292
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,             # <<<<<<<<<<<<<<
 *                     'size': info.size,
 *                     'replication': info.replication,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info->last_access_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_access_time, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":293
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,             # <<<<<<<<<<<<<<
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info->size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":294
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,
 *                     'replication': info.replication,             # <<<<<<<<<<<<<<
 *                     'block_size': info.block_size,
 *                     'permissions': info.permissions
 */
      __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info->replication); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_replication, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":295
 *                     'size': info.size,
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,             # <<<<<<<<<<<<<<
 *                     'permissions': info.permissions
 *                 })
 */
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info->block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_block_size, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":296
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,
 *                     'permissions': info.permissions             # <<<<<<<<<<<<<<
 *                 })
 *             else:
 */
      __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info->permissions); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_permissions, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":286
 *                         else 'directory')
 * 
 *                 results.append({             # <<<<<<<<<<<<<<
 *                     'kind': kind,
 *                     'name': name,
 */
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(2, 286, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/io-hdfs.pxi":282
 *             name = strip_hdfs_abspath(frombytes(info.name))
 * 
 *             if full_info:             # <<<<<<<<<<<<<<
 *                 kind = ('file' if info.kind == ObjectType_FILE
 *                         else 'directory')
 */
      goto __pyx_L8;
    }

    /* "pyarrow/io-hdfs.pxi":299
 *                 })
 *             else:
 *                 results.append(name)             # <<<<<<<<<<<<<<
 * 
 *         return results
 */
    /*else*/ {
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(2, 299, __pyx_L1_error)
    }
    __pyx_L8:;
  }

  /* "pyarrow/io-hdfs.pxi":301
 *                 results.append(name)
 * 
 *         return results             # <<<<<<<<<<<<<<
 * 
 *     def chmod(self, path, mode):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_results);
  __pyx_r = __pyx_v_results;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":262
 *                          .GetPathInfo(c_path, info))
 * 
 *     def ls(self, path, bint full_info):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string c_path = tobytes(path)
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.ls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_results);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":303
 *         return results
 * 
 *     def chmod(self, path, mode):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_28chmod[] = "HadoopFileSystem.chmod(self, path, mode)\n\n        Change file permissions\n\n        Parameters\n        ----------\n        path : string\n            absolute path to file or directory\n        mode : int\n            POSIX-like bitmask\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chmod (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("chmod", 1, 2, 2, 1); __PYX_ERR(2, 303, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chmod") < 0)) __PYX_ERR(2, 303, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chmod", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 303, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode) {
  std::string __pyx_v_c_path;
  int __pyx_v_c_mode;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("chmod", 0);

  /* "pyarrow/io-hdfs.pxi":314
 *             POSIX-like bitmask
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":315
 *         """
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef int c_mode = mode
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":316
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_mode); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 316, __pyx_L1_error)
  __pyx_v_c_mode = __pyx_t_5;

  /* "pyarrow/io-hdfs.pxi":317
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chmod(c_path, c_mode))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":318
 *         cdef int c_mode = mode
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Chmod(c_path, c_mode))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Chmod(__pyx_v_c_path, __pyx_v_c_mode)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 318, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":317
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chmod(c_path, c_mode))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":303
 *         return results
 * 
 *     def chmod(self, path, mode):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

  /* 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.lib.HadoopFileSystem.chmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":321
 *                          .Chmod(c_path, c_mode))
 * 
 *     def chown(self, path, owner=None, group=None):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_30chown[] = "HadoopFileSystem.chown(self, path, owner=None, group=None)\n\n        Change file permissions\n\n        Parameters\n        ----------\n        path : string\n            absolute path to file or directory\n        owner : string, default None\n            New owner, None for no change\n        group : string, default None\n            New group, None for no change\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_owner = 0;
  PyObject *__pyx_v_group = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chown (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_owner,&__pyx_n_s_group,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_owner);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_group);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chown") < 0)) __PYX_ERR(2, 321, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_owner = values[1];
    __pyx_v_group = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chown", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 321, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_owner, __pyx_v_group);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_owner, PyObject *__pyx_v_group) {
  std::string __pyx_v_c_path;
  std::string __pyx_v_c_owner;
  std::string __pyx_v_c_group;
  char const *__pyx_v_c_owner_ptr;
  char const *__pyx_v_c_group_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("chown", 0);

  /* "pyarrow/io-hdfs.pxi":338
 *             c_string c_owner
 *             c_string c_group
 *             const char* c_owner_ptr = NULL             # <<<<<<<<<<<<<<
 *             const char* c_group_ptr = NULL
 * 
 */
  __pyx_v_c_owner_ptr = NULL;

  /* "pyarrow/io-hdfs.pxi":339
 *             c_string c_group
 *             const char* c_owner_ptr = NULL
 *             const char* c_group_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *         self._ensure_client()
 */
  __pyx_v_c_group_ptr = NULL;

  /* "pyarrow/io-hdfs.pxi":341
 *             const char* c_group_ptr = NULL
 * 
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":343
 *         self._ensure_client()
 * 
 *         c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         if owner is not None:
 *             c_owner = tobytes(owner)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":344
 * 
 *         c_path = tobytes(path)
 *         if owner is not None:             # <<<<<<<<<<<<<<
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()
 */
  __pyx_t_5 = (__pyx_v_owner != Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io-hdfs.pxi":345
 *         c_path = tobytes(path)
 *         if owner is not None:
 *             c_owner = tobytes(owner)             # <<<<<<<<<<<<<<
 *             c_owner_ptr = c_owner.c_str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_owner) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_owner);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_owner = __pyx_t_4;

    /* "pyarrow/io-hdfs.pxi":346
 *         if owner is not None:
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()             # <<<<<<<<<<<<<<
 * 
 *         if group is not None:
 */
    __pyx_v_c_owner_ptr = __pyx_v_c_owner.c_str();

    /* "pyarrow/io-hdfs.pxi":344
 * 
 *         c_path = tobytes(path)
 *         if owner is not None:             # <<<<<<<<<<<<<<
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()
 */
  }

  /* "pyarrow/io-hdfs.pxi":348
 *             c_owner_ptr = c_owner.c_str()
 * 
 *         if group is not None:             # <<<<<<<<<<<<<<
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()
 */
  __pyx_t_6 = (__pyx_v_group != Py_None);
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io-hdfs.pxi":349
 * 
 *         if group is not None:
 *             c_group = tobytes(group)             # <<<<<<<<<<<<<<
 *             c_group_ptr = c_group.c_str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_group) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_group);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_group = __pyx_t_4;

    /* "pyarrow/io-hdfs.pxi":350
 *         if group is not None:
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_group_ptr = __pyx_v_c_group.c_str();

    /* "pyarrow/io-hdfs.pxi":348
 *             c_owner_ptr = c_owner.c_str()
 * 
 *         if group is not None:             # <<<<<<<<<<<<<<
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()
 */
  }

  /* "pyarrow/io-hdfs.pxi":352
 *             c_group_ptr = c_group.c_str()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":353
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Chown(__pyx_v_c_path, __pyx_v_c_owner_ptr, __pyx_v_c_group_ptr)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 353, __pyx_L6_error)
      }

      /* "pyarrow/io-hdfs.pxi":352
 *             c_group_ptr = c_group.c_str()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":321
 *                          .Chmod(c_path, c_mode))
 * 
 *     def chown(self, path, owner=None, group=None):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

  /* 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.lib.HadoopFileSystem.chown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":356
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 *     def mkdir(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Create indicated directory and any necessary parent directories
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_32mkdir[] = "HadoopFileSystem.mkdir(self, path)\n\n        Create indicated directory and any necessary parent directories\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mkdir (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("mkdir", 0);

  /* "pyarrow/io-hdfs.pxi":360
 *         Create indicated directory and any necessary parent directories
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":361
 *         """
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":362
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .MakeDirectory(c_path))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":363
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .MakeDirectory(c_path))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->MakeDirectory(__pyx_v_c_path)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 363, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":362
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .MakeDirectory(c_path))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":356
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 *     def mkdir(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Create indicated directory and any necessary parent directories
 */

  /* 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.lib.HadoopFileSystem.mkdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":366
 *                          .MakeDirectory(c_path))
 * 
 *     def delete(self, path, bint recursive=False):             # <<<<<<<<<<<<<<
 *         """
 *         Delete the indicated file or directory
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_34delete[] = "HadoopFileSystem.delete(self, path, bool recursive=False)\n\n        Delete the indicated file or directory\n\n        Parameters\n        ----------\n        path : string\n        recursive : boolean, default False\n            If True, also delete child paths for directories\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  int __pyx_v_recursive;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_recursive,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_recursive);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(2, 366, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    if (values[1]) {
      __pyx_v_recursive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_recursive == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 366, __pyx_L3_error)
    } else {
      __pyx_v_recursive = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 366, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_recursive);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_recursive) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "pyarrow/io-hdfs.pxi":376
 *             If True, also delete child paths for directories
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":378
 *         self._ensure_client()
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":379
 * 
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Delete(c_path, recursive == 1))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":380
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Delete(c_path, recursive == 1))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Delete(__pyx_v_c_path, (__pyx_v_recursive == 1))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 380, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":379
 * 
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Delete(c_path, recursive == 1))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":366
 *                          .MakeDirectory(c_path))
 * 
 *     def delete(self, path, bint recursive=False):             # <<<<<<<<<<<<<<
 *         """
 *         Delete the indicated file or directory
 */

  /* 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.lib.HadoopFileSystem.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_36open[] = "HadoopFileSystem.open(self, path, mode=u'rb', buffer_size=None, replication=None, default_block_size=None)\n\n        Open HDFS file for reading or writing\n\n        Parameters\n        ----------\n        mode : string\n            Must be one of 'rb', 'wb', 'ab'\n\n        Returns\n        -------\n        handle : HdfsFile\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_v_replication = 0;
  PyObject *__pyx_v_default_block_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,&__pyx_n_s_buffer_size,&__pyx_n_s_replication,&__pyx_n_s_default_block_size,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_rb_2);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);

    /* "pyarrow/io-hdfs.pxi":384
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,
 *              default_block_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Open HDFS file for reading or writing
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_replication);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default_block_size);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(2, 383, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_buffer_size = values[2];
    __pyx_v_replication = values[3];
    __pyx_v_default_block_size = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 383, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_buffer_size, __pyx_v_replication, __pyx_v_default_block_size);

  /* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_replication, PyObject *__pyx_v_default_block_size) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_out = 0;
  std::string __pyx_v_c_path;
  bool __pyx_v_append;
  int32_t __pyx_v_c_buffer_size;
  int16_t __pyx_v_c_replication;
  int64_t __pyx_v_c_default_block_size;
  std::shared_ptr<arrow::io::HdfsOutputStream>  __pyx_v_wr_handle;
  std::shared_ptr<arrow::io::HdfsReadableFile>  __pyx_v_rd_handle;
  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;
  std::string __pyx_t_6;
  int32_t __pyx_t_7;
  int32_t __pyx_t_8;
  int16_t __pyx_t_9;
  int16_t __pyx_t_10;
  int64_t __pyx_t_11;
  int64_t __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/io-hdfs.pxi":397
 *         handle : HdfsFile
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef HdfsFile out = HdfsFile()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":399
 *         self._ensure_client()
 * 
 *         cdef HdfsFile out = HdfsFile()             # <<<<<<<<<<<<<<
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_HdfsFile)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":401
 *         cdef HdfsFile out = HdfsFile()
 * 
 *         if mode not in ('rb', 'wb', 'ab'):             # <<<<<<<<<<<<<<
 *             raise Exception("Mode must be 'rb' (read), "
 *                             "'wb' (write, new file), or 'ab' (append)")
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ab, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/io-hdfs.pxi":402
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 *             raise Exception("Mode must be 'rb' (read), "             # <<<<<<<<<<<<<<
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 402, __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(2, 402, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":401
 *         cdef HdfsFile out = HdfsFile()
 * 
 *         if mode not in ('rb', 'wb', 'ab'):             # <<<<<<<<<<<<<<
 *             raise Exception("Mode must be 'rb' (read), "
 *                             "'wb' (write, new file), or 'ab' (append)")
 */
  }

  /* "pyarrow/io-hdfs.pxi":405
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_bool append = False
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_6;

  /* "pyarrow/io-hdfs.pxi":406
 * 
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool append = False             # <<<<<<<<<<<<<<
 * 
 *         # 0 in libhdfs means "use the default"
 */
  __pyx_v_append = 0;

  /* "pyarrow/io-hdfs.pxi":409
 * 
 *         # 0 in libhdfs means "use the default"
 *         cdef int32_t c_buffer_size = buffer_size or 0             # <<<<<<<<<<<<<<
 *         cdef int16_t c_replication = replication or 0
 *         cdef int64_t c_default_block_size = default_block_size or 0
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 409, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 409, __pyx_L1_error)
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_L7_bool_binop_done:;
  __pyx_v_c_buffer_size = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":410
 *         # 0 in libhdfs means "use the default"
 *         cdef int32_t c_buffer_size = buffer_size or 0
 *         cdef int16_t c_replication = replication or 0             # <<<<<<<<<<<<<<
 *         cdef int64_t c_default_block_size = default_block_size or 0
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_replication); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_v_replication); if (unlikely((__pyx_t_10 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 410, __pyx_L1_error)
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_9 = 0;
  __pyx_L9_bool_binop_done:;
  __pyx_v_c_replication = __pyx_t_9;

  /* "pyarrow/io-hdfs.pxi":411
 *         cdef int32_t c_buffer_size = buffer_size or 0
 *         cdef int16_t c_replication = replication or 0
 *         cdef int64_t c_default_block_size = default_block_size or 0             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[HdfsOutputStream] wr_handle
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_default_block_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_default_block_size); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 411, __pyx_L1_error)
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_11 = 0;
  __pyx_L11_bool_binop_done:;
  __pyx_v_c_default_block_size = __pyx_t_11;

  /* "pyarrow/io-hdfs.pxi":416
 *         cdef shared_ptr[HdfsReadableFile] rd_handle
 * 
 *         if mode in ('wb', 'ab'):             # <<<<<<<<<<<<<<
 *             if mode == 'ab':
 *                 append = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 416, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 416, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":417
 * 
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':             # <<<<<<<<<<<<<<
 *                 append = True
 * 
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 417, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "pyarrow/io-hdfs.pxi":418
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':
 *                 append = True             # <<<<<<<<<<<<<<
 * 
 *             with nogil:
 */
      __pyx_v_append = 1;

      /* "pyarrow/io-hdfs.pxi":417
 * 
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':             # <<<<<<<<<<<<<<
 *                 append = True
 * 
 */
    }

    /* "pyarrow/io-hdfs.pxi":420
 *                 append = True
 * 
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     self.client.get()
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":421
 * 
 *             with nogil:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     self.client.get()
 *                     .OpenWritable(c_path, append, c_buffer_size,
 */
          __pyx_t_13 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->OpenWritable(__pyx_v_c_path, __pyx_v_append, __pyx_v_c_buffer_size, __pyx_v_c_replication, __pyx_v_c_default_block_size, (&__pyx_v_wr_handle))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 421, __pyx_L18_error)
        }

        /* "pyarrow/io-hdfs.pxi":420
 *                 append = True
 * 
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     self.client.get()
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L19;
          }
          __pyx_L18_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L19:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":427
 *                                   &wr_handle))
 * 
 *             out.set_output_stream(<shared_ptr[OutputStream]> wr_handle)             # <<<<<<<<<<<<<<
 *             out.is_writable = True
 *         else:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_out), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_wr_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":428
 * 
 *             out.set_output_stream(<shared_ptr[OutputStream]> wr_handle)
 *             out.is_writable = True             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
 */
    __pyx_v_out->__pyx_base.is_writable = 1;

    /* "pyarrow/io-hdfs.pxi":416
 *         cdef shared_ptr[HdfsReadableFile] rd_handle
 * 
 *         if mode in ('wb', 'ab'):             # <<<<<<<<<<<<<<
 *             if mode == 'ab':
 *                 append = True
 */
    goto __pyx_L13;
  }

  /* "pyarrow/io-hdfs.pxi":430
 *             out.is_writable = True
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.client.get()
 *                              .OpenReadable(c_path, &rd_handle))
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":431
 *         else:
 *             with nogil:
 *                 check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                              .OpenReadable(c_path, &rd_handle))
 * 
 */
          __pyx_t_13 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->OpenReadable(__pyx_v_c_path, (&__pyx_v_rd_handle))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 431, __pyx_L21_error)
        }

        /* "pyarrow/io-hdfs.pxi":430
 *             out.is_writable = True
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.client.get()
 *                              .OpenReadable(c_path, &rd_handle))
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L22;
          }
          __pyx_L21_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L22:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":434
 *                              .OpenReadable(c_path, &rd_handle))
 * 
 *             out.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 <shared_ptr[RandomAccessFile]> rd_handle)
 *             out.is_readable = True
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_out), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_rd_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":436
 *             out.set_random_access_file(
 *                 <shared_ptr[RandomAccessFile]> rd_handle)
 *             out.is_readable = True             # <<<<<<<<<<<<<<
 * 
 *         assert not out.closed
 */
    __pyx_v_out->__pyx_base.is_readable = 1;
  }
  __pyx_L13:;

  /* "pyarrow/io-hdfs.pxi":438
 *             out.is_readable = True
 * 
 *         assert not out.closed             # <<<<<<<<<<<<<<
 * 
 *         if c_buffer_size == 0:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 438, __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(2, 438, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!((!__pyx_t_2) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(2, 438, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/io-hdfs.pxi":440
 *         assert not out.closed
 * 
 *         if c_buffer_size == 0:             # <<<<<<<<<<<<<<
 *             c_buffer_size = 2 ** 16
 * 
 */
  __pyx_t_2 = ((__pyx_v_c_buffer_size == 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":441
 * 
 *         if c_buffer_size == 0:
 *             c_buffer_size = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 *         out.mode = mode
 */
    __pyx_v_c_buffer_size = 0x10000;

    /* "pyarrow/io-hdfs.pxi":440
 *         assert not out.closed
 * 
 *         if c_buffer_size == 0:             # <<<<<<<<<<<<<<
 *             c_buffer_size = 2 ** 16
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":443
 *             c_buffer_size = 2 ** 16
 * 
 *         out.mode = mode             # <<<<<<<<<<<<<<
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)
 */
  __Pyx_INCREF(__pyx_v_mode);
  __Pyx_GIVEREF(__pyx_v_mode);
  __Pyx_GOTREF(__pyx_v_out->mode);
  __Pyx_DECREF(__pyx_v_out->mode);
  __pyx_v_out->mode = __pyx_v_mode;

  /* "pyarrow/io-hdfs.pxi":444
 * 
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size             # <<<<<<<<<<<<<<
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.own_file = True
 */
  __pyx_v_out->buffer_size = __pyx_v_c_buffer_size;

  /* "pyarrow/io-hdfs.pxi":445
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)             # <<<<<<<<<<<<<<
 *         out.own_file = True
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_out));
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib__HdfsFileNanny), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_out->parent);
  __Pyx_DECREF(__pyx_v_out->parent);
  __pyx_v_out->parent = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/io-hdfs.pxi":446
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.own_file = True             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
  __pyx_v_out->__pyx_base.own_file = 1;

  /* "pyarrow/io-hdfs.pxi":448
 *         out.own_file = True
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def download(self, path, stream, buffer_size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":450
 *         return out
 * 
 *     def download(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_38download[] = "HadoopFileSystem.download(self, path, stream, buffer_size=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("download (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("download", 0, 2, 3, 1); __PYX_ERR(2, 450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "download") < 0)) __PYX_ERR(2, 450, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_stream = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("download", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 450, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_v_f = NULL;
  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 = 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_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("download", 0);

  /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_rb_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_rb_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
      __Pyx_INCREF(__pyx_n_u_rb_2);
      __Pyx_GIVEREF(__pyx_n_u_rb_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_u_rb_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 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_f = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "pyarrow/io-hdfs.pxi":452
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     def upload(self, path, stream, buffer_size=None):
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_download); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_stream);
          __Pyx_GIVEREF(__pyx_v_stream);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stream);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer_size, __pyx_v_buffer_size) < 0) __PYX_ERR(2, 452, __pyx_L7_error)
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
        }
        __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_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(2, 451, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          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_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__224, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "pyarrow/io-hdfs.pxi":450
 *         return out
 * 
 *     def download(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":454
 *             f.download(stream, buffer_size=buffer_size)
 * 
 *     def upload(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Upload file-like object to HDFS path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_40upload[] = "HadoopFileSystem.upload(self, path, stream, buffer_size=None)\n\n        Upload file-like object to HDFS path\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upload (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("upload", 0, 2, 3, 1); __PYX_ERR(2, 454, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "upload") < 0)) __PYX_ERR(2, 454, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_stream = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upload", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 454, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_v_f = NULL;
  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 = 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_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("upload", 0);

  /* "pyarrow/io-hdfs.pxi":458
 *         Upload file-like object to HDFS path
 *         """
 *         with self.open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.upload(stream, buffer_size=buffer_size)
 * 
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_wb};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_wb};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
      __Pyx_INCREF(__pyx_n_u_wb);
      __Pyx_GIVEREF(__pyx_n_u_wb);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_u_wb);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 458, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 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_f = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "pyarrow/io-hdfs.pxi":459
 *         """
 *         with self.open(path, 'wb') as f:
 *             f.upload(stream, buffer_size=buffer_size)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_upload); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_stream);
          __Pyx_GIVEREF(__pyx_v_stream);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stream);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer_size, __pyx_v_buffer_size) < 0) __PYX_ERR(2, 459, __pyx_L7_error)
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyarrow/io-hdfs.pxi":458
 *         Upload file-like object to HDFS path
 *         """
 *         with self.open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.upload(stream, buffer_size=buffer_size)
 * 
 */
        }
        __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_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(2, 458, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          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_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__224, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 458, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "pyarrow/io-hdfs.pxi":454
 *             f.download(stream, buffer_size=buffer_size)
 * 
 *     def upload(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Upload file-like object to HDFS path
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":61
 * 
 *     cdef readonly:
 *         bint is_open             # <<<<<<<<<<<<<<
 *         object host
 *         object user
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.is_open.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":62
 *     cdef readonly:
 *         bint is_open
 *         object host             # <<<<<<<<<<<<<<
 *         object user
 *         object kerb_ticket
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->host);
  __pyx_r = __pyx_v_self->host;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":63
 *         bint is_open
 *         object host
 *         object user             # <<<<<<<<<<<<<<
 *         object kerb_ticket
 *         object driver
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->user);
  __pyx_r = __pyx_v_self->user;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":64
 *         object host
 *         object user
 *         object kerb_ticket             # <<<<<<<<<<<<<<
 *         object driver
 *         int port
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->kerb_ticket);
  __pyx_r = __pyx_v_self->kerb_ticket;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":65
 *         object user
 *         object kerb_ticket
 *         object driver             # <<<<<<<<<<<<<<
 *         int port
 *         dict extra_conf
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->driver);
  __pyx_r = __pyx_v_self->driver;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":66
 *         object kerb_ticket
 *         object driver
 *         int port             # <<<<<<<<<<<<<<
 *         dict extra_conf
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->port); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.port.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":67
 *         object driver
 *         int port
 *         dict extra_conf             # <<<<<<<<<<<<<<
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->extra_conf);
  __pyx_r = __pyx_v_self->extra_conf;
  goto __pyx_L0;

  /* function exit code */
  __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_3lib_16HadoopFileSystem_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__[] = "HadoopFileSystem.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.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_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.__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_3lib_16HadoopFileSystem_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__[] = "HadoopFileSystem.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.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_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 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_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":471
 *         object file_handle_ref
 * 
 *     def __cinit__(self, client, file_handle):             # <<<<<<<<<<<<<<
 *         import weakref
 *         self.client = client
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_client = 0;
  PyObject *__pyx_v_file_handle = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_client,&__pyx_n_s_file_handle,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_handle)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(2, 471, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 471, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_client = values[0];
    __pyx_v_file_handle = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 471, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self), __pyx_v_client, __pyx_v_file_handle);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_file_handle) {
  PyObject *__pyx_v_weakref = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io-hdfs.pxi":472
 * 
 *     def __cinit__(self, client, file_handle):
 *         import weakref             # <<<<<<<<<<<<<<
 *         self.client = client
 *         self.file_handle_ref = weakref.ref(file_handle)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_weakref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":473
 *     def __cinit__(self, client, file_handle):
 *         import weakref
 *         self.client = client             # <<<<<<<<<<<<<<
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 */
  __Pyx_INCREF(__pyx_v_client);
  __Pyx_GIVEREF(__pyx_v_client);
  __Pyx_GOTREF(__pyx_v_self->client);
  __Pyx_DECREF(__pyx_v_self->client);
  __pyx_v_self->client = __pyx_v_client;

  /* "pyarrow/io-hdfs.pxi":474
 *         import weakref
 *         self.client = client
 *         self.file_handle_ref = weakref.ref(file_handle)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_weakref, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_file_handle) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_file_handle);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->file_handle_ref);
  __Pyx_DECREF(__pyx_v_self->file_handle_ref);
  __pyx_v_self->file_handle_ref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":471
 *         object file_handle_ref
 * 
 *     def __cinit__(self, client, file_handle):             # <<<<<<<<<<<<<<
 *         import weakref
 *         self.client = client
 */

  /* 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.lib._HdfsFileNanny.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weakref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":476
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         fh = self.file_handle_ref()
 *         if fh:
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self) {
  PyObject *__pyx_v_fh = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":477
 * 
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()             # <<<<<<<<<<<<<<
 *         if fh:
 *             fh.close()
 */
  __Pyx_INCREF(__pyx_v_self->file_handle_ref);
  __pyx_t_2 = __pyx_v_self->file_handle_ref; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":478
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()
 *         if fh:             # <<<<<<<<<<<<<<
 *             fh.close()
 *         # avoid cyclic GC
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_fh); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 478, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io-hdfs.pxi":479
 *         fh = self.file_handle_ref()
 *         if fh:
 *             fh.close()             # <<<<<<<<<<<<<<
 *         # avoid cyclic GC
 *         self.file_handle_ref = None
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fh, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":478
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()
 *         if fh:             # <<<<<<<<<<<<<<
 *             fh.close()
 *         # avoid cyclic GC
 */
  }

  /* "pyarrow/io-hdfs.pxi":481
 *             fh.close()
 *         # avoid cyclic GC
 *         self.file_handle_ref = None             # <<<<<<<<<<<<<<
 *         self.client = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->file_handle_ref);
  __Pyx_DECREF(__pyx_v_self->file_handle_ref);
  __pyx_v_self->file_handle_ref = Py_None;

  /* "pyarrow/io-hdfs.pxi":482
 *         # avoid cyclic GC
 *         self.file_handle_ref = None
 *         self.client = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->client);
  __Pyx_DECREF(__pyx_v_self->client);
  __pyx_v_self->client = Py_None;

  /* "pyarrow/io-hdfs.pxi":476
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         fh = self.file_handle_ref()
 *         if fh:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pyarrow.lib._HdfsFileNanny.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fh);
  __Pyx_RefNannyFinishContext();
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__[] = "_HdfsFileNanny.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__[] = "_HdfsFileNanny.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":491
 *         object parent
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.parent = None
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":492
 * 
 *     def __dealloc__(self):
 *         self.parent = None             # <<<<<<<<<<<<<<
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->parent);
  __Pyx_DECREF(__pyx_v_self->parent);
  __pyx_v_self->parent = Py_None;

  /* "pyarrow/io-hdfs.pxi":491
 *         object parent
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.parent = None
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io-hdfs.pxi":487
 * cdef class HdfsFile(NativeFile):
 *     cdef readonly:
 *         int32_t buffer_size             # <<<<<<<<<<<<<<
 *         object mode
 *         object parent
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->buffer_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HdfsFile.buffer_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":488
 *     cdef readonly:
 *         int32_t buffer_size
 *         object mode             # <<<<<<<<<<<<<<
 *         object parent
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->mode);
  __pyx_r = __pyx_v_self->mode;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":489
 *         int32_t buffer_size
 *         object mode
 *         object parent             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->parent);
  __pyx_r = __pyx_v_self->parent;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8HdfsFile_2__reduce_cython__[] = "HdfsFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HdfsFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8HdfsFile_4__setstate_cython__[] = "HdfsFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HdfsFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":24
 *     Container for an Arrow IPC message with metadata and optional body
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_7Message_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_7Message_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message___cinit__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_7Message___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":27
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.read_message` function instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_7Message_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_7Message_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_2__init__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_7Message_2__init__(struct __pyx_obj_7pyarrow_3lib_Message *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/ipc.pxi":30
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.read_message` function instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_8, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":28
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.ipc.read_message` function instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(7, 28, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":27
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.read_message` function instead."
 */

  /* 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.lib.Message.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":33
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return frombytes(FormatMessageType(self.message.get().type()))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4type___get__(struct __pyx_obj_7pyarrow_3lib_Message *__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;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":34
 *     @property
 *     def type(self):
 *         return frombytes(FormatMessageType(self.message.get().type()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(arrow::ipc::FormatMessageType(__pyx_v_self->message.get()->type())); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(7, 34, __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/ipc.pxi":33
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return frombytes(FormatMessageType(self.message.get().type()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Message.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":37
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(self.message.get().metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":38
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_buffer(self.message.get().metadata())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_self->message.get()->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":37
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(self.message.get().metadata())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":41
 * 
 *     @property
 *     def body(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4body_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4body_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_4body___get__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4body___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_body;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":42
 *     @property
 *     def body(self):
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()             # <<<<<<<<<<<<<<
 *         if body.get() == NULL:
 *             return None
 */
  __pyx_v_body = __pyx_v_self->message.get()->body();

  /* "pyarrow/ipc.pxi":43
 *     def body(self):
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_body.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":44
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_buffer(body)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/ipc.pxi":43
 *     def body(self):
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "pyarrow/ipc.pxi":46
 *             return None
 *         else:
 *             return pyarrow_wrap_buffer(body)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Message other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_body); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/ipc.pxi":41
 * 
 *     @property
 *     def body(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Message.body.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":48
 *             return pyarrow_wrap_buffer(body)
 * 
 *     def equals(self, Message other):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the message contents (metadata and body) are identical
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_4equals[] = "Message.equals(self, Message other)\n\n        Returns True if the message contents (metadata and body) are identical\n\n        Parameters\n        ----------\n        other : Message\n\n        Returns\n        -------\n        are_equal : bool\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Message, 1, "other", 0))) __PYX_ERR(7, 48, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_4equals(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4equals(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_other) {
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/ipc.pxi":61
 *         """
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.message.get().Equals(deref(other.message.get()))
 *         return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":62
 *         cdef c_bool result
 *         with nogil:
 *             result = self.message.get().Equals(deref(other.message.get()))             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        __pyx_v_result = __pyx_v_self->message.get()->Equals((*__pyx_v_other->message.get()));
      }

      /* "pyarrow/ipc.pxi":61
 *         """
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.message.get().Equals(deref(other.message.get()))
 *         return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":63
 *         with nogil:
 *             result = self.message.get().Equals(deref(other.message.get()))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def serialize_to(self, NativeFile sink, alignment=8, memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":48
 *             return pyarrow_wrap_buffer(body)
 * 
 *     def equals(self, Message other):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the message contents (metadata and body) are identical
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":65
 *         return result
 * 
 *     def serialize_to(self, NativeFile sink, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message to generic OutputStream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_7serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_6serialize_to[] = "Message.serialize_to(self, NativeFile sink, alignment=8, memory_pool=None)\n\n        Write message to generic OutputStream\n\n        Parameters\n        ----------\n        sink : NativeFile\n        alignment : int, default 8\n            Byte alignment for metadata and body\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_7serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_sink = 0;
  PyObject *__pyx_v_alignment = 0;
  CYTHON_UNUSED PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize_to (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__pyx_n_s_alignment,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_int_8);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alignment);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize_to") < 0)) __PYX_ERR(7, 65, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sink = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_alignment = values[1];
    __pyx_v_memory_pool = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize_to", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 65, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Message.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sink), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "sink", 0))) __PYX_ERR(7, 65, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_6serialize_to(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), __pyx_v_sink, __pyx_v_alignment, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_6serialize_to(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_sink, PyObject *__pyx_v_alignment, CYTHON_UNUSED PyObject *__pyx_v_memory_pool) {
  int64_t __pyx_v_output_length;
  arrow::io::OutputStream *__pyx_v_out;
   arrow::ipc::IpcOptions __pyx_v_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int32_t __pyx_t_1;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("serialize_to", 0);

  /* "pyarrow/ipc.pxi":78
 *         """
 *         cdef:
 *             int64_t output_length = 0             # <<<<<<<<<<<<<<
 *             OutputStream* out
 *             CIpcOptions options
 */
  __pyx_v_output_length = 0;

  /* "pyarrow/ipc.pxi":82
 *             CIpcOptions options
 * 
 *         options.alignment = alignment             # <<<<<<<<<<<<<<
 *         out = sink.get_output_stream().get()
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_alignment); if (unlikely((__pyx_t_1 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 82, __pyx_L1_error)
  __pyx_v_options.alignment = __pyx_t_1;

  /* "pyarrow/ipc.pxi":83
 * 
 *         options.alignment = alignment
 *         out = sink.get_output_stream().get()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.message.get()
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_sink->__pyx_vtab)->get_output_stream(__pyx_v_sink); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 83, __pyx_L1_error)
  __pyx_v_out = __pyx_t_2.get();

  /* "pyarrow/ipc.pxi":84
 *         options.alignment = alignment
 *         out = sink.get_output_stream().get()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(out, options, &output_length))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":85
 *         out = sink.get_output_stream().get()
 *         with nogil:
 *             check_status(self.message.get()             # <<<<<<<<<<<<<<
 *                          .SerializeTo(out, options, &output_length))
 * 
 */
        __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->message.get()->SerializeTo(__pyx_v_out, __pyx_v_options, (&__pyx_v_output_length))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 85, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":84
 *         options.alignment = alignment
 *         out = sink.get_output_stream().get()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(out, options, &output_length))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":65
 *         return result
 * 
 *     def serialize_to(self, NativeFile sink, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message to generic OutputStream
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Message.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":88
 *                          .SerializeTo(out, options, &output_length))
 * 
 *     def serialize(self, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_9serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_8serialize[] = "Message.serialize(self, alignment=8, memory_pool=None)\n\n        Write message as encapsulated IPC message\n\n        Parameters\n        ----------\n        alignment : int, default 8\n            Byte alignment for metadata and body\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n\n        Returns\n        -------\n        serialized : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_9serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_alignment = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alignment,&__pyx_n_s_memory_pool,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_8);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alignment);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(7, 88, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_alignment = values[0];
    __pyx_v_memory_pool = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 88, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Message.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_8serialize(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), __pyx_v_alignment, __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8serialize(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, PyObject *__pyx_v_alignment, PyObject *__pyx_v_memory_pool) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_stream = 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;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/ipc.pxi":103
 *         serialized : Buffer
 *         """
 *         stream = BufferOutputStream(memory_pool)             # <<<<<<<<<<<<<<
 *         self.serialize_to(stream, alignment=alignment, memory_pool=memory_pool)
 *         return stream.getvalue()
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferOutputStream), __pyx_v_memory_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":104
 *         """
 *         stream = BufferOutputStream(memory_pool)
 *         self.serialize_to(stream, alignment=alignment, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *         return stream.getvalue()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_serialize_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_stream));
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alignment, __pyx_v_alignment) < 0) __PYX_ERR(7, 104, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(7, 104, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":105
 *         stream = BufferOutputStream(memory_pool)
 *         self.serialize_to(stream, alignment=alignment, memory_pool=memory_pool)
 *         return stream.getvalue()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_stream), __pyx_n_s_getvalue); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":88
 *                          .SerializeTo(out, options, &output_length))
 * 
 *     def serialize(self, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message as encapsulated IPC 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_AddTraceback("pyarrow.lib.Message.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":107
 *         return stream.getvalue()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.message == nullptr:
 *             return """pyarrow.Message(unitialized)"""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_11__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_11__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_10__repr__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_10__repr__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  PyObject *__pyx_v_metadata_len = NULL;
  PyObject *__pyx_v_body = NULL;
  PyObject *__pyx_v_body_len = 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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/ipc.pxi":108
 * 
 *     def __repr__(self):
 *         if self.message == nullptr:             # <<<<<<<<<<<<<<
 *             return """pyarrow.Message(unitialized)"""
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->message == nullptr) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":109
 *     def __repr__(self):
 *         if self.message == nullptr:
 *             return """pyarrow.Message(unitialized)"""             # <<<<<<<<<<<<<<
 * 
 *         metadata_len = self.metadata.size
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u_pyarrow_Message_unitialized);
    __pyx_r = __pyx_kp_u_pyarrow_Message_unitialized;
    goto __pyx_L0;

    /* "pyarrow/ipc.pxi":108
 * 
 *     def __repr__(self):
 *         if self.message == nullptr:             # <<<<<<<<<<<<<<
 *             return """pyarrow.Message(unitialized)"""
 * 
 */
  }

  /* "pyarrow/ipc.pxi":111
 *             return """pyarrow.Message(unitialized)"""
 * 
 *         metadata_len = self.metadata.size             # <<<<<<<<<<<<<<
 *         body = self.body
 *         body_len = 0 if body is None else body.size
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_metadata_len = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":112
 * 
 *         metadata_len = self.metadata.size
 *         body = self.body             # <<<<<<<<<<<<<<
 *         body_len = 0 if body is None else body.size
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_body); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_body = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":113
 *         metadata_len = self.metadata.size
 *         body = self.body
 *         body_len = 0 if body is None else body.size             # <<<<<<<<<<<<<<
 * 
 *         return """pyarrow.Message
 */
  __pyx_t_1 = (__pyx_v_body == Py_None);
  if ((__pyx_t_1 != 0)) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_v_body_len = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":115
 *         body_len = 0 if body is None else body.size
 * 
 *         return """pyarrow.Message             # <<<<<<<<<<<<<<
 * type: {0}
 * metadata length: {1}
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/ipc.pxi":118
 * type: {0}
 * metadata length: {1}
 * body length: {2}""".format(self.type, metadata_len, body_len)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Message_type_0_metadata, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_metadata_len, __pyx_v_body_len};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 118, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_metadata_len, __pyx_v_body_len};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 118, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_metadata_len);
    __Pyx_GIVEREF(__pyx_v_metadata_len);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_metadata_len);
    __Pyx_INCREF(__pyx_v_body_len);
    __Pyx_GIVEREF(__pyx_v_body_len);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_body_len);
    __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":107
 *         return stream.getvalue()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.message == nullptr:
 *             return """pyarrow.Message(unitialized)"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Message.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_metadata_len);
  __Pyx_XDECREF(__pyx_v_body);
  __Pyx_XDECREF(__pyx_v_body_len);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_12__reduce_cython__[] = "Message.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_12__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_14__setstate_cython__[] = "Message.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_14__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":129
 *         unique_ptr[CMessageReader] reader
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13MessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13MessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader___cinit__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13MessageReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":132
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13MessageReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13MessageReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_2__init__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13MessageReader_2__init__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/ipc.pxi":135
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 *                         "instead.".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_9, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":133
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 *                         "instead.".format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(7, 133, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":132
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 */

  /* 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.lib.MessageReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":138
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_4open_stream[] = "MessageReader.open_stream(source)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13MessageReader_5open_stream = {"open_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13MessageReader_4open_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_stream") < 0)) __PYX_ERR(7, 138, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open_stream", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 138, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.open_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_4open_stream(__pyx_v_source);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_4open_stream(PyObject *__pyx_v_source) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_result = 0;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_in_stream;
  std::unique_ptr< arrow::ipc::MessageReader>  __pyx_v_reader;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("open_stream", 0);

  /* "pyarrow/ipc.pxi":139
 *     @staticmethod
 *     def open_stream(source):
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[InputStream] in_stream
 *         cdef unique_ptr[CMessageReader] reader
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_MessageReader(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_MessageReader), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 139, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":142
 *         cdef shared_ptr[InputStream] in_stream
 *         cdef unique_ptr[CMessageReader] reader
 *         _get_input_stream(source, &in_stream)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             reader = CMessageReader.Open(in_stream)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_input_stream(__pyx_v_source, (&__pyx_v_in_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":143
 *         cdef unique_ptr[CMessageReader] reader
 *         _get_input_stream(source, &in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             reader = CMessageReader.Open(in_stream)
 *             result.reader.reset(reader.release())
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":144
 *         _get_input_stream(source, &in_stream)
 *         with nogil:
 *             reader = CMessageReader.Open(in_stream)             # <<<<<<<<<<<<<<
 *             result.reader.reset(reader.release())
 * 
 */
        __pyx_v_reader =  arrow::ipc::MessageReader::Open(__pyx_v_in_stream);

        /* "pyarrow/ipc.pxi":145
 *         with nogil:
 *             reader = CMessageReader.Open(in_stream)
 *             result.reader.reset(reader.release())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result->reader.reset(__pyx_v_reader.release());
      }

      /* "pyarrow/ipc.pxi":143
 *         cdef unique_ptr[CMessageReader] reader
 *         _get_input_stream(source, &in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             reader = CMessageReader.Open(in_stream)
 *             result.reader.reset(reader.release())
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":147
 *             result.reader.reset(reader.release())
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":138
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.open_stream", __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;
}
static PyObject *__pyx_gb_7pyarrow_3lib_13MessageReader_8generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/ipc.pxi":149
 *         return result
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_message()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_7__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_7__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_6__iter__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_6__iter__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(7, 149, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_13MessageReader_8generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MessageReader___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(7, 149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_13MessageReader_8generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 149, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":150
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_message()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":151
 *     def __iter__(self):
 *         while True:
 *             yield self.read_next_message()             # <<<<<<<<<<<<<<
 * 
 *     def read_next_message(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_read_next_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 151, __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;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 151, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":149
 *         return result
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_message()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":153
 *             yield self.read_next_message()
 * 
 *     def read_next_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next Message from the stream. Raises StopIteration at end of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_10read_next_message(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_9read_next_message[] = "MessageReader.read_next_message(self)\n\n        Read next Message from the stream. Raises StopIteration at end of\n        stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_10read_next_message(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_next_message (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_9read_next_message(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_9read_next_message(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("read_next_message", 0);

  /* "pyarrow/ipc.pxi":158
 *         stream
 *         """
 *         cdef Message result = Message.__new__(Message)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Message(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Message), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 158, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":160
 *         cdef Message result = Message.__new__(Message)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":161
 * 
 *         with nogil:
 *             check_status(self.reader.get().ReadNextMessage(&result.message))             # <<<<<<<<<<<<<<
 * 
 *         if result.message.get() == NULL:
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadNextMessage((&__pyx_v_result->message))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 161, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":160
 *         cdef Message result = Message.__new__(Message)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":163
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 *         if result.message.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  __pyx_t_3 = ((__pyx_v_result->message.get() == NULL) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/ipc.pxi":164
 * 
 *         if result.message.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(7, 164, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":163
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 *         if result.message.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":166
 *             raise StopIteration
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":153
 *             yield self.read_next_message()
 * 
 *     def read_next_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next Message from the stream. Raises StopIteration at end of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.read_next_message", __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;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_12__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_11__reduce_cython__[] = "MessageReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_12__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_11__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_11__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__233, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_14__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_13__setstate_cython__[] = "MessageReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_14__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_13__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_13__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__234, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":180
 *     # cdef block is in lib.pxd
 * 
 *     def write(self, table_or_batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch or Table to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write(PyObject *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_write[] = "_CRecordBatchWriter.write(self, table_or_batch)\n\n        Write RecordBatch or Table to stream\n\n        Parameters\n        ----------\n        table_or_batch : {RecordBatch, Table}\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write(PyObject *__pyx_v_self, PyObject *__pyx_v_table_or_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v_table_or_batch));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_table_or_batch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/ipc.pxi":188
 *         table_or_batch : {RecordBatch, Table}
 *         """
 *         if isinstance(table_or_batch, RecordBatch):             # <<<<<<<<<<<<<<
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_table_or_batch, __pyx_ptype_7pyarrow_3lib_RecordBatch); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":189
 *         """
 *         if isinstance(table_or_batch, RecordBatch):
 *             self.write_batch(table_or_batch)             # <<<<<<<<<<<<<<
 *         elif isinstance(table_or_batch, Table):
 *             self.write_table(table_or_batch)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_batch); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_table_or_batch) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_table_or_batch);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":188
 *         table_or_batch : {RecordBatch, Table}
 *         """
 *         if isinstance(table_or_batch, RecordBatch):             # <<<<<<<<<<<<<<
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":190
 *         if isinstance(table_or_batch, RecordBatch):
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):             # <<<<<<<<<<<<<<
 *             self.write_table(table_or_batch)
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_table_or_batch, __pyx_ptype_7pyarrow_3lib_Table); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/ipc.pxi":191
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):
 *             self.write_table(table_or_batch)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(type(table_or_batch))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_table_or_batch) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_table_or_batch);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":190
 *         if isinstance(table_or_batch, RecordBatch):
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):             # <<<<<<<<<<<<<<
 *             self.write_table(table_or_batch)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":193
 *             self.write_table(table_or_batch)
 *         else:
 *             raise ValueError(type(table_or_batch))             # <<<<<<<<<<<<<<
 * 
 *     def write_batch(self, RecordBatch batch):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, ((PyObject *)Py_TYPE(__pyx_v_table_or_batch))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 193, __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(7, 193, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":180
 *     # cdef block is in lib.pxd
 * 
 *     def write(self, table_or_batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch or Table to stream
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":195
 *             raise ValueError(type(table_or_batch))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch(PyObject *__pyx_v_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch[] = "_CRecordBatchWriter.write_batch(self, RecordBatch batch)\n\n        Write RecordBatch to stream\n\n        Parameters\n        ----------\n        batch : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch(PyObject *__pyx_v_self, PyObject *__pyx_v_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_batch (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_batch), __pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "batch", 0))) __PYX_ERR(7, 195, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_batch));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("write_batch", 0);

  /* "pyarrow/ipc.pxi":203
 *         batch : RecordBatch
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get()
 *                          .WriteRecordBatch(deref(batch.batch)))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":204
 *         """
 *         with nogil:
 *             check_status(self.writer.get()             # <<<<<<<<<<<<<<
 *                          .WriteRecordBatch(deref(batch.batch)))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->WriteRecordBatch((*__pyx_v_batch->batch))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 204, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":203
 *         batch : RecordBatch
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get()
 *                          .WriteRecordBatch(deref(batch.batch)))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":195
 *             raise ValueError(type(table_or_batch))
 * 
 *     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.lib._CRecordBatchWriter.write_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":207
 *                          .WriteRecordBatch(deref(batch.batch)))
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Write Table to stream in (contiguous) RecordBatch objects, with maximum
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_4write_table[] = "_CRecordBatchWriter.write_table(self, Table table, max_chunksize=None, **kwargs)\n\n        Write Table to stream in (contiguous) RecordBatch objects, with maximum\n        chunk size\n\n        Parameters\n        ----------\n        table : Table\n        max_chunksize : int, default None\n            Maximum size for RecordBatch chunks. Individual chunks may be\n            smaller depending on the chunk layout of individual columns\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_v_max_chunksize = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_table (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table,&__pyx_n_s_max_chunksize,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_chunksize);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "write_table") < 0)) __PYX_ERR(7, 207, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)values[0]);
    __pyx_v_max_chunksize = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_table", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 207, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.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_ptype_7pyarrow_3lib_Table, 1, "table", 0))) __PYX_ERR(7, 207, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__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;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int64_t __pyx_t_8;
  __Pyx_RefNannySetupContext("write_table", 0);
  __Pyx_INCREF(__pyx_v_max_chunksize);

  /* "pyarrow/ipc.pxi":221
 *         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/ipc.pxi":223
 *             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_n_u_chunksize, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 223, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":224
 * 
 *         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_3 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_u_chunksize); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_max_chunksize, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":225
 *         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_kp_u_The_parameter_chunksize_is_depre_2);
    __pyx_v_msg = __pyx_kp_u_The_parameter_chunksize_is_depre_2;

    /* "pyarrow/ipc.pxi":228
 *                    'methods as of 0.15, please use parameter '
 *                    'max_chunksize instead')
 *             warnings.warn(msg, FutureWarning)             # <<<<<<<<<<<<<<
 * 
 *         if max_chunksize is not None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_msg);
      __Pyx_GIVEREF(__pyx_v_msg);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_msg);
      __Pyx_INCREF(__pyx_builtin_FutureWarning);
      __Pyx_GIVEREF(__pyx_builtin_FutureWarning);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_builtin_FutureWarning);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":223
 *             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/ipc.pxi":230
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 * 
 */
  __pyx_t_2 = (__pyx_v_max_chunksize != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":231
 * 
 *         if max_chunksize is not None:
 *             c_max_chunksize = max_chunksize             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_max_chunksize); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 231, __pyx_L1_error)
    __pyx_v_c_max_chunksize = __pyx_t_8;

    /* "pyarrow/ipc.pxi":230
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 * 
 */
  }

  /* "pyarrow/ipc.pxi":233
 *             c_max_chunksize = max_chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().WriteTable(table.table[0],
 *                                                       c_max_chunksize))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":234
 * 
 *         with nogil:
 *             check_status(self.writer.get().WriteTable(table.table[0],             # <<<<<<<<<<<<<<
 *                                                       c_max_chunksize))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->WriteTable((__pyx_v_table->table[0]), __pyx_v_c_max_chunksize)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 234, __pyx_L6_error)
      }

      /* "pyarrow/ipc.pxi":233
 *             c_max_chunksize = max_chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().WriteTable(table.table[0],
 *                                                       c_max_chunksize))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/ipc.pxi":207
 *                          .WriteRecordBatch(deref(batch.batch)))
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Write Table to stream in (contiguous) RecordBatch objects, with maximum
 */

  /* 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_7);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.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/ipc.pxi":237
 *                                                       c_max_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_6close[] = "_CRecordBatchWriter.close(self)\n\n        Close stream and write end-of-stream 0 marker\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/ipc.pxi":241
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":242
 *         """
 *         with nogil:
 *             check_status(self.writer.get().Close())             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Close()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 242, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":241
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":237
 *                                                       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.lib._CRecordBatchWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":244
 *             check_status(self.writer.get().Close())
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__[] = "_CRecordBatchWriter.__enter__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/ipc.pxi":245
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":244
 *             check_status(self.writer.get().Close())
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":247
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__[] = "_CRecordBatchWriter.__exit__(self, exc_type, exc_val, exc_tb)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(7, 247, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(7, 247, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(7, 247, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 247, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pyarrow/ipc.pxi":248
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":247
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__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.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__[] = "_CRecordBatchWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__235, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__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_3lib_19_CRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__[] = "_CRecordBatchWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__236, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":257
 *         bint closed
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":260
 *         pass
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/ipc.pxi":264
 * 
 *     @property
 *     def _use_legacy_format(self):             # <<<<<<<<<<<<<<
 *         return self.options.write_legacy_ipc_format
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":265
 *     @property
 *     def _use_legacy_format(self):
 *         return self.options.write_legacy_ipc_format             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.write_legacy_ipc_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":264
 * 
 *     @property
 *     def _use_legacy_format(self):             # <<<<<<<<<<<<<<
 *         return self.options.write_legacy_ipc_format
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter._use_legacy_format.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":267
 *         return self.options.write_legacy_ipc_format
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CResult[shared_ptr[CRecordBatchWriter]] result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open[] = "_RecordBatchStreamWriter._open(self, sink, Schema schema, use_legacy_format=False)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sink = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_use_legacy_format = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__pyx_n_s_schema,&__pyx_n_s_use_legacy_format,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, 1); __PYX_ERR(7, 267, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_legacy_format);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(7, 267, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sink = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_use_legacy_format = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 267, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(7, 267, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self), __pyx_v_sink, __pyx_v_schema, __pyx_v_use_legacy_format);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format) {
  arrow::Result<std::shared_ptr< arrow::ipc::RecordBatchWriter> >  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr< arrow::ipc::RecordBatchWriter>  __pyx_t_3;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":271
 *             CResult[shared_ptr[CRecordBatchWriter]] result
 * 
 *         self.options.write_legacy_ipc_format = use_legacy_format             # <<<<<<<<<<<<<<
 *         get_writer(sink, &self.sink)
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_legacy_format); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(7, 271, __pyx_L1_error)
  __pyx_v_self->options.write_legacy_ipc_format = __pyx_t_1;

  /* "pyarrow/ipc.pxi":272
 * 
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             result = CRecordBatchStreamWriter.Open(
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_self->sink)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":273
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = CRecordBatchStreamWriter.Open(
 *                 self.sink.get(), schema.sp_schema, self.options)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":274
 *         get_writer(sink, &self.sink)
 *         with nogil:
 *             result = CRecordBatchStreamWriter.Open(             # <<<<<<<<<<<<<<
 *                 self.sink.get(), schema.sp_schema, self.options)
 *         self.writer = GetResultValue(result)
 */
        __pyx_v_result =  arrow::ipc::RecordBatchStreamWriter::Open(__pyx_v_self->sink.get(), __pyx_v_schema->sp_schema, __pyx_v_self->options);
      }

      /* "pyarrow/ipc.pxi":273
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = CRecordBatchStreamWriter.Open(
 *                 self.sink.get(), schema.sp_schema, self.options)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":276
 *             result = CRecordBatchStreamWriter.Open(
 *                 self.sink.get(), schema.sp_schema, self.options)
 *         self.writer = GetResultValue(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr< arrow::ipc::RecordBatchWriter> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 276, __pyx_L1_error)
  __pyx_v_self->__pyx_base.writer = __pyx_t_3;

  /* "pyarrow/ipc.pxi":267
 *         return self.options.write_legacy_ipc_format
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CResult[shared_ptr[CRecordBatchWriter]] result
 */

  /* 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.lib._RecordBatchStreamWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__[] = "_RecordBatchStreamWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__237, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__[] = "_RecordBatchStreamWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__238, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":279
 * 
 * 
 * cdef _get_input_stream(object source, shared_ptr[InputStream]* out):             # <<<<<<<<<<<<<<
 *     try:
 *         source = as_buffer(source)
 */

static PyObject *__pyx_f_7pyarrow_3lib__get_input_stream(PyObject *__pyx_v_source, std::shared_ptr<arrow::io::InputStream>  *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_get_input_stream", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":280
 * 
 * cdef _get_input_stream(object source, shared_ptr[InputStream]* out):
 *     try:             # <<<<<<<<<<<<<<
 *         source = as_buffer(source)
 *     except TypeError:
 */
  {
    __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/ipc.pxi":281
 * cdef _get_input_stream(object source, shared_ptr[InputStream]* out):
 *     try:
 *         source = as_buffer(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         # Non-buffer-like
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 281, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 281, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/ipc.pxi":280
 * 
 * cdef _get_input_stream(object source, shared_ptr[InputStream]* out):
 *     try:             # <<<<<<<<<<<<<<
 *         source = as_buffer(source)
 *     except TypeError:
 */
    }
    __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;

    /* "pyarrow/ipc.pxi":282
 *     try:
 *         source = as_buffer(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         # Non-buffer-like
 *         pass
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/ipc.pxi":280
 * 
 * cdef _get_input_stream(object source, shared_ptr[InputStream]* out):
 *     try:             # <<<<<<<<<<<<<<
 *         source = as_buffer(source)
 *     except TypeError:
 */
    __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_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/ipc.pxi":286
 *         pass
 * 
 *     get_input_stream(source, True, out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_get_input_stream(__pyx_v_source, 1, __pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":279
 * 
 * 
 * cdef _get_input_stream(object source, shared_ptr[InputStream]* out):             # <<<<<<<<<<<<<<
 *     try:
 *         source = as_buffer(source)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/ipc.pxi":298
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(7, 298, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_CRecordBatchReader___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(7, 298, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 298, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":299
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_batch()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":300
 *     def __iter__(self):
 *         while True:
 *             yield self.read_next_batch()             # <<<<<<<<<<<<<<
 * 
 *     def get_next_batch(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_read_next_batch); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 300, __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;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 300, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":298
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":302
 *             yield self.read_next_batch()
 * 
 *     def get_next_batch(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch[] = "_CRecordBatchReader.get_next_batch(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_next_batch (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_next_batch", 0);

  /* "pyarrow/ipc.pxi":303
 * 
 *     def get_next_batch(self):
 *         import warnings             # <<<<<<<<<<<<<<
 *         warnings.warn('Please use read_next_batch instead of '
 *                       'get_next_batch', FutureWarning)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_warnings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":304
 *     def get_next_batch(self):
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '             # <<<<<<<<<<<<<<
 *                       'get_next_batch', FutureWarning)
 *         return self.read_next_batch()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/ipc.pxi":305
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 *                       'get_next_batch', FutureWarning)             # <<<<<<<<<<<<<<
 *         return self.read_next_batch()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__239, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 304, __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;

  /* "pyarrow/ipc.pxi":306
 *         warnings.warn('Please use read_next_batch instead of '
 *                       'get_next_batch', FutureWarning)
 *         return self.read_next_batch()             # <<<<<<<<<<<<<<
 * 
 *     def read_next_batch(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_next_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 306, __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/ipc.pxi":302
 *             yield self.read_next_batch()
 * 
 *     def get_next_batch(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.get_next_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":308
 *         return self.read_next_batch()
 * 
 *     def read_next_batch(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next RecordBatch from the stream. Raises StopIteration at end of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch[] = "_CRecordBatchReader.read_next_batch(self)\n\n        Read next RecordBatch from the stream. Raises StopIteration at end of\n        stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_next_batch (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read_next_batch", 0);

  /* "pyarrow/ipc.pxi":315
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":316
 * 
 *         with nogil:
 *             check_status(self.reader.get().ReadNext(&batch))             # <<<<<<<<<<<<<<
 * 
 *         if batch.get() == NULL:
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadNext((&__pyx_v_batch))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 316, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":315
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":318
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 *         if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  __pyx_t_2 = ((__pyx_v_batch.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/ipc.pxi":319
 * 
 *         if batch.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(batch)
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(7, 319, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":318
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 *         if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":321
 *             raise StopIteration
 * 
 *         return pyarrow_wrap_batch(batch)             # <<<<<<<<<<<<<<
 * 
 *     def read_all(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":308
 *         return self.read_next_batch()
 * 
 *     def read_next_batch(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next RecordBatch from the stream. Raises StopIteration at end of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.read_next_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":323
 *         return pyarrow_wrap_batch(batch)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_7read_all[] = "_CRecordBatchReader.read_all(self)\n\n        Read all record batches as a pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_all (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "pyarrow/ipc.pxi":328
 *         """
 *         cdef shared_ptr[CTable] table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":329
 *         cdef shared_ptr[CTable] table
 *         with nogil:
 *             check_status(self.reader.get().ReadAll(&table))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_table(table)
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadAll((&__pyx_v_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 329, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":328
 *         """
 *         cdef shared_ptr[CTable] table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":330
 *         with nogil:
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":323
 *         return pyarrow_wrap_batch(batch)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.read_all", __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_3lib_19_CRecordBatchReader_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__[] = "_CRecordBatchReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__240, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__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_3lib_19_CRecordBatchReader_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__[] = "_CRecordBatchReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__241, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":340
 *         Schema schema
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":343
 *         pass
 * 
 *     def _open(self, source):             # <<<<<<<<<<<<<<
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_2_open[] = "_RecordBatchStreamReader._open(self, source)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self), ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":344
 * 
 *     def _open(self, source):
 *         _get_input_stream(source, &self.in_stream)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CRecordBatchStreamReader.Open(
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_input_stream(__pyx_v_source, (&__pyx_v_self->in_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":345
 *     def _open(self, source):
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CRecordBatchStreamReader.Open(
 *                 self.in_stream.get(), &self.reader))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":346
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 *             check_status(CRecordBatchStreamReader.Open(             # <<<<<<<<<<<<<<
 *                 self.in_stream.get(), &self.reader))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchStreamReader::Open(__pyx_v_self->in_stream.get(), (&__pyx_v_self->__pyx_base.reader))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 346, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":345
 *     def _open(self, source):
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CRecordBatchStreamReader.Open(
 *                 self.in_stream.get(), &self.reader))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":349
 *                 self.in_stream.get(), &self.reader))
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->__pyx_base.reader.get()->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(7, 349, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->schema);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->schema));
  __pyx_v_self->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":343
 *         pass
 * 
 *     def _open(self, source):             # <<<<<<<<<<<<<<
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 */

  /* 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.lib._RecordBatchStreamReader._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":338
 * 
 *     cdef readonly:
 *         Schema schema             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->schema));
  __pyx_r = ((PyObject *)__pyx_v_self->schema);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__[] = "_RecordBatchStreamReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__242, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__[] = "_RecordBatchStreamReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__243, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":354
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CResult[shared_ptr[CRecordBatchWriter]] result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_1_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter__open[] = "_RecordBatchFileWriter._open(self, sink, Schema schema, use_legacy_format=False)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_1_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sink = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_use_legacy_format = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__pyx_n_s_schema,&__pyx_n_s_use_legacy_format,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, 1); __PYX_ERR(7, 354, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_legacy_format);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(7, 354, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sink = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_use_legacy_format = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 354, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(7, 354, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter__open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *)__pyx_v_self), __pyx_v_sink, __pyx_v_schema, __pyx_v_use_legacy_format);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter__open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format) {
  arrow::Result<std::shared_ptr< arrow::ipc::RecordBatchWriter> >  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr< arrow::ipc::RecordBatchWriter>  __pyx_t_3;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":358
 *             CResult[shared_ptr[CRecordBatchWriter]] result
 * 
 *         self.options.write_legacy_ipc_format = use_legacy_format             # <<<<<<<<<<<<<<
 *         get_writer(sink, &self.sink)
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_legacy_format); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(7, 358, __pyx_L1_error)
  __pyx_v_self->__pyx_base.options.write_legacy_ipc_format = __pyx_t_1;

  /* "pyarrow/ipc.pxi":359
 * 
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             result = CRecordBatchFileWriter.Open(self.sink.get(),
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_self->__pyx_base.sink)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":360
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = CRecordBatchFileWriter.Open(self.sink.get(),
 *                                                  schema.sp_schema,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":361
 *         get_writer(sink, &self.sink)
 *         with nogil:
 *             result = CRecordBatchFileWriter.Open(self.sink.get(),             # <<<<<<<<<<<<<<
 *                                                  schema.sp_schema,
 *                                                  self.options)
 */
        __pyx_v_result =  arrow::ipc::RecordBatchFileWriter::Open(__pyx_v_self->__pyx_base.sink.get(), __pyx_v_schema->sp_schema, __pyx_v_self->__pyx_base.options);
      }

      /* "pyarrow/ipc.pxi":360
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = CRecordBatchFileWriter.Open(self.sink.get(),
 *                                                  schema.sp_schema,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":364
 *                                                  schema.sp_schema,
 *                                                  self.options)
 *         self.writer = GetResultValue(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr< arrow::ipc::RecordBatchWriter> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 364, __pyx_L1_error)
  __pyx_v_self->__pyx_base.__pyx_base.writer = __pyx_t_3;

  /* "pyarrow/ipc.pxi":354
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CResult[shared_ptr[CRecordBatchWriter]] result
 */

  /* 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.lib._RecordBatchFileWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__[] = "_RecordBatchFileWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__244, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__[] = "_RecordBatchFileWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__245, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":375
 *         Schema schema
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":378
 *         pass
 * 
 *     def _open(self, source, footer_offset=None):             # <<<<<<<<<<<<<<
 *         try:
 *             source = as_buffer(source)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_2_open[] = "_RecordBatchFileReader._open(self, source, footer_offset=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_footer_offset = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_footer_offset,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_footer_offset);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(7, 378, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_footer_offset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 378, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_2_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self), __pyx_v_source, __pyx_v_footer_offset);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_footer_offset) {
  int64_t __pyx_v_offset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("_open", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":379
 * 
 *     def _open(self, source, footer_offset=None):
 *         try:             # <<<<<<<<<<<<<<
 *             source = as_buffer(source)
 *         except TypeError:
 */
  {
    __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/ipc.pxi":380
 *     def _open(self, source, footer_offset=None):
 *         try:
 *             source = as_buffer(source)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             pass
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 380, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 380, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/ipc.pxi":379
 * 
 *     def _open(self, source, footer_offset=None):
 *         try:             # <<<<<<<<<<<<<<
 *             source = as_buffer(source)
 *         except TypeError:
 */
    }
    __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;

    /* "pyarrow/ipc.pxi":381
 *         try:
 *             source = as_buffer(source)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/ipc.pxi":379
 * 
 *     def _open(self, source, footer_offset=None):
 *         try:             # <<<<<<<<<<<<<<
 *             source = as_buffer(source)
 *         except TypeError:
 */
    __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_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/ipc.pxi":384
 *             pass
 * 
 *         get_reader(source, True, &self.file)             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t offset = 0
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_source, 1, (&__pyx_v_self->file)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":386
 *         get_reader(source, True, &self.file)
 * 
 *         cdef int64_t offset = 0             # <<<<<<<<<<<<<<
 *         if footer_offset is not None:
 *             offset = footer_offset
 */
  __pyx_v_offset = 0;

  /* "pyarrow/ipc.pxi":387
 * 
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:             # <<<<<<<<<<<<<<
 *             offset = footer_offset
 * 
 */
  __pyx_t_8 = (__pyx_v_footer_offset != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/ipc.pxi":388
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:
 *             offset = footer_offset             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_footer_offset); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 388, __pyx_L1_error)
    __pyx_v_offset = __pyx_t_10;

    /* "pyarrow/ipc.pxi":387
 * 
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:             # <<<<<<<<<<<<<<
 *             offset = footer_offset
 * 
 */
  }

  /* "pyarrow/ipc.pxi":390
 *             offset = footer_offset
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if offset != 0:
 *                 check_status(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":391
 * 
 *         with nogil:
 *             if offset != 0:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 */
        __pyx_t_9 = ((__pyx_v_offset != 0) != 0);
        if (__pyx_t_9) {

          /* "pyarrow/ipc.pxi":392
 *         with nogil:
 *             if offset != 0:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 *                                                  &self.reader))
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchFileReader:: Open(__pyx_v_self->file.get(), __pyx_v_offset, (&__pyx_v_self->reader))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 392, __pyx_L11_error)

          /* "pyarrow/ipc.pxi":391
 * 
 *         with nogil:
 *             if offset != 0:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 */
          goto __pyx_L13;
        }

        /* "pyarrow/ipc.pxi":396
 *                                                  &self.reader))
 *             else:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))
 * 
 */
        /*else*/ {

          /* "pyarrow/ipc.pxi":397
 *             else:
 *                 check_status(
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))             # <<<<<<<<<<<<<<
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchFileReader::Open(__pyx_v_self->file.get(), (&__pyx_v_self->reader))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 396, __pyx_L11_error)
        }
        __pyx_L13:;
      }

      /* "pyarrow/ipc.pxi":390
 *             offset = footer_offset
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if offset != 0:
 *                 check_status(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L12;
        }
        __pyx_L11_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pyarrow/ipc.pxi":399
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->reader.get()->schema()); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(7, 399, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->schema);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->schema));
  __pyx_v_self->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":378
 *         pass
 * 
 *     def _open(self, source, footer_offset=None):             # <<<<<<<<<<<<<<
 *         try:
 *             source = as_buffer(source)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":402
 * 
 *     @property
 *     def num_record_batches(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_record_batches()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":403
 *     @property
 *     def num_record_batches(self):
 *         return self.reader.get().num_record_batches()             # <<<<<<<<<<<<<<
 * 
 *     def get_batch(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->reader.get()->num_record_batches()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":402
 * 
 *     @property
 *     def num_record_batches(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_record_batches()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.num_record_batches.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":405
 *         return self.reader.get().num_record_batches()
 * 
 *     def get_batch(self, int i):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_5get_batch(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch[] = "_RecordBatchFileReader.get_batch(self, int i)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_5get_batch(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_batch (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 405, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.get_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("get_batch", 0);

  /* "pyarrow/ipc.pxi":408
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         if i < 0 or i >= self.num_record_batches:             # <<<<<<<<<<<<<<
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 */
  __pyx_t_2 = ((__pyx_v_i < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_record_batches); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/ipc.pxi":409
 * 
 *         if i < 0 or i >= self.num_record_batches:
 *             raise ValueError('Batch number {0} out of range'.format(i))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Batch_number_0_out_of_range, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 409, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":408
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         if i < 0 or i >= self.num_record_batches:             # <<<<<<<<<<<<<<
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 */
  }

  /* "pyarrow/ipc.pxi":411
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":412
 * 
 *         with nogil:
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(batch)
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadRecordBatch(__pyx_v_i, (&__pyx_v_batch))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 412, __pyx_L7_error)
      }

      /* "pyarrow/ipc.pxi":411
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/ipc.pxi":414
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))
 * 
 *         return pyarrow_wrap_batch(batch)             # <<<<<<<<<<<<<<
 * 
 *     # TODO(wesm): ARROW-503: Function was renamed. Remove after a period of
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_batch); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":405
 *         return self.reader.get().num_record_batches()
 * 
 *     def get_batch(self, int i):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.get_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":420
 *     get_record_batch = get_batch
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_7read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_6read_all[] = "_RecordBatchFileReader.read_all(self)\n\n        Read all record batches as a pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_7read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_all (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6read_all(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6read_all(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::RecordBatch> >  __pyx_v_batches;
  std::shared_ptr< arrow::Table>  __pyx_v_table;
  int __pyx_v_i;
  int __pyx_v_nbatches;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "pyarrow/ipc.pxi":429
 *             int i, nbatches
 * 
 *         nbatches = self.num_record_batches             # <<<<<<<<<<<<<<
 * 
 *         batches.resize(nbatches)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_record_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nbatches = __pyx_t_2;

  /* "pyarrow/ipc.pxi":431
 *         nbatches = self.num_record_batches
 * 
 *         batches.resize(nbatches)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             for i in range(nbatches):
 */
  try {
    __pyx_v_batches.resize(__pyx_v_nbatches);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 431, __pyx_L1_error)
  }

  /* "pyarrow/ipc.pxi":432
 * 
 *         batches.resize(nbatches)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":433
 *         batches.resize(nbatches)
 *         with nogil:
 *             for i in range(nbatches):             # <<<<<<<<<<<<<<
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,
 */
        __pyx_t_2 = __pyx_v_nbatches;
        __pyx_t_3 = __pyx_t_2;
        for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
          __pyx_v_i = __pyx_t_4;

          /* "pyarrow/ipc.pxi":434
 *         with nogil:
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))             # <<<<<<<<<<<<<<
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,
 *                                                   batches, &table))
 */
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadRecordBatch(__pyx_v_i, (&(__pyx_v_batches[__pyx_v_i])))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 434, __pyx_L4_error)
        }

        /* "pyarrow/ipc.pxi":435
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,             # <<<<<<<<<<<<<<
 *                                                   batches, &table))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::Table::FromRecordBatches(__pyx_v_self->schema->sp_schema, __pyx_v_batches, (&__pyx_v_table))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 435, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":432
 * 
 *         batches.resize(nbatches)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":438
 *                                                   batches, &table))
 * 
 *         return pyarrow_wrap_table(table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":420
 *     get_record_batch = get_batch
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":373
 * 
 *     cdef readonly:
 *         Schema schema             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6schema___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->schema));
  __pyx_r = ((PyObject *)__pyx_v_self->schema);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__[] = "_RecordBatchFileReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__246, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_10__setstate_cython__[] = "_RecordBatchFileReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__247, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":441
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_179get_tensor_size(PyObject *__pyx_self, PyObject *__pyx_v_tensor); /*proto*/
static char __pyx_doc_7pyarrow_3lib_178get_tensor_size[] = "get_tensor_size(Tensor tensor)\n\n    Return total size of serialized Tensor including metadata and padding\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_179get_tensor_size = {"get_tensor_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_179get_tensor_size, METH_O, __pyx_doc_7pyarrow_3lib_178get_tensor_size};
static PyObject *__pyx_pw_7pyarrow_3lib_179get_tensor_size(PyObject *__pyx_self, PyObject *__pyx_v_tensor) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tensor_size (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tensor), __pyx_ptype_7pyarrow_3lib_Tensor, 1, "tensor", 0))) __PYX_ERR(7, 441, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_178get_tensor_size(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_tensor));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_178get_tensor_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor) {
  int64_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_tensor_size", 0);

  /* "pyarrow/ipc.pxi":446
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetTensorSize(deref(tensor.tp), &size))
 *     return size
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":447
 *     cdef int64_t size
 *     with nogil:
 *         check_status(GetTensorSize(deref(tensor.tp), &size))             # <<<<<<<<<<<<<<
 *     return size
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::GetTensorSize((*__pyx_v_tensor->tp), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 447, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":446
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetTensorSize(deref(tensor.tp), &size))
 *     return size
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":448
 *     with nogil:
 *         check_status(GetTensorSize(deref(tensor.tp), &size))
 *     return size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":441
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.get_tensor_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":451
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_181get_record_batch_size(PyObject *__pyx_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_180get_record_batch_size[] = "get_record_batch_size(RecordBatch batch)\n\n    Return total size of serialized RecordBatch including metadata and padding\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_181get_record_batch_size = {"get_record_batch_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_181get_record_batch_size, METH_O, __pyx_doc_7pyarrow_3lib_180get_record_batch_size};
static PyObject *__pyx_pw_7pyarrow_3lib_181get_record_batch_size(PyObject *__pyx_self, PyObject *__pyx_v_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_record_batch_size (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_batch), __pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "batch", 0))) __PYX_ERR(7, 451, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_180get_record_batch_size(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_batch));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_180get_record_batch_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch) {
  int64_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_record_batch_size", 0);

  /* "pyarrow/ipc.pxi":456
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))
 *     return size
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":457
 *     cdef int64_t size
 *     with nogil:
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))             # <<<<<<<<<<<<<<
 *     return size
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::GetRecordBatchSize((*__pyx_v_batch->batch), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 457, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":456
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))
 *     return size
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":458
 *     with nogil:
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))
 *     return size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":451
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.get_record_batch_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":461
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_183write_tensor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_182write_tensor[] = "write_tensor(Tensor tensor, NativeFile dest)\n\n    Write pyarrow.Tensor to pyarrow.NativeFile object its current position\n\n    Parameters\n    ----------\n    tensor : pyarrow.Tensor\n    dest : pyarrow.NativeFile\n\n    Returns\n    -------\n    bytes_written : int\n        Total number of bytes written to the file\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_183write_tensor = {"write_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_183write_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_182write_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_183write_tensor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor = 0;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_dest = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_tensor (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tensor,&__pyx_n_s_dest,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tensor)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_tensor", 1, 2, 2, 1); __PYX_ERR(7, 461, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_tensor") < 0)) __PYX_ERR(7, 461, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_tensor = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)values[0]);
    __pyx_v_dest = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_tensor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 461, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.write_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tensor), __pyx_ptype_7pyarrow_3lib_Tensor, 1, "tensor", 0))) __PYX_ERR(7, 461, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "dest", 0))) __PYX_ERR(7, 461, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_182write_tensor(__pyx_self, __pyx_v_tensor, __pyx_v_dest);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_182write_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_dest) {
  int32_t __pyx_v_metadata_length;
  int64_t __pyx_v_body_length;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("write_tensor", 0);

  /* "pyarrow/ipc.pxi":479
 *         int64_t body_length
 * 
 *     handle = dest.get_output_stream()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_dest->__pyx_vtab)->get_output_stream(__pyx_v_dest); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 479, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/ipc.pxi":481
 *     handle = dest.get_output_stream()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), handle.get(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":482
 * 
 *     with nogil:
 *         check_status(             # <<<<<<<<<<<<<<
 *             WriteTensor(deref(tensor.tp), handle.get(),
 *                         &metadata_length, &body_length))
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::WriteTensor((*__pyx_v_tensor->tp), __pyx_v_handle.get(), (&__pyx_v_metadata_length), (&__pyx_v_body_length))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 482, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":481
 *     handle = dest.get_output_stream()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), handle.get(),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":486
 *                         &metadata_length, &body_length))
 * 
 *     return metadata_length + body_length             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t((__pyx_v_metadata_length + __pyx_v_body_length)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":461
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.write_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":489
 * 
 * 
 * cdef NativeFile as_native_file(source):             # <<<<<<<<<<<<<<
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):
 */

static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib_as_native_file(PyObject *__pyx_v_source) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_native_file", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":490
 * 
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":491
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
    __pyx_t_2 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 491, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/ipc.pxi":492
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)             # <<<<<<<<<<<<<<
 *         else:
 *             source = BufferReader(source)
 */
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_v_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/ipc.pxi":491
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
      goto __pyx_L4;
    }

    /* "pyarrow/ipc.pxi":494
 *             source = PythonFile(source)
 *         else:
 *             source = BufferReader(source)             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(source, NativeFile):
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_v_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "pyarrow/ipc.pxi":490
 * 
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)
 */
  }

  /* "pyarrow/ipc.pxi":496
 *             source = BufferReader(source)
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/ipc.pxi":498
 *     if not isinstance(source, NativeFile):
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))             # <<<<<<<<<<<<<<
 *     return source
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_read_message_from_obje, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_source))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_source)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/ipc.pxi":497
 * 
 *     if not isinstance(source, NativeFile):
 *         raise ValueError('Unable to read message from object with type: {0}'             # <<<<<<<<<<<<<<
 *                          .format(type(source)))
 *     return source
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 497, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":496
 *             source = BufferReader(source)
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))
 */
  }

  /* "pyarrow/ipc.pxi":499
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))
 *     return source             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(7, 499, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_source);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_source);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":489
 * 
 * 
 * cdef NativeFile as_native_file(source):             # <<<<<<<<<<<<<<
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.as_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":502
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_185read_tensor(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_184read_tensor[] = "read_tensor(source)\nRead pyarrow.Tensor from pyarrow.NativeFile object from current\n    position. If the file source supports zero copy (e.g. a memory map), then\n    this operation does not allocate any memory. This function not assume that\n    the stream is aligned\n\n    Parameters\n    ----------\n    source : pyarrow.NativeFile\n\n    Returns\n    -------\n    tensor : Tensor\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_185read_tensor = {"read_tensor", (PyCFunction)__pyx_pw_7pyarrow_3lib_185read_tensor, METH_O, __pyx_doc_7pyarrow_3lib_184read_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_185read_tensor(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_tensor (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_184read_tensor(__pyx_self, ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_184read_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  std::shared_ptr< arrow::Tensor>  __pyx_v_sp_tensor;
  arrow::io::InputStream *__pyx_v_c_stream;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("read_tensor", 0);

  /* "pyarrow/ipc.pxi":521
 *         InputStream* c_stream
 * 
 *     cdef NativeFile nf = as_native_file(source)             # <<<<<<<<<<<<<<
 * 
 *     c_stream = nf.get_input_stream().get()
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_as_native_file(__pyx_v_source)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":523
 *     cdef NativeFile nf = as_native_file(source)
 * 
 *     c_stream = nf.get_input_stream().get()             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(ReadTensor(c_stream, &sp_tensor))
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_input_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 523, __pyx_L1_error)
  __pyx_v_c_stream = __pyx_t_2.get();

  /* "pyarrow/ipc.pxi":524
 * 
 *     c_stream = nf.get_input_stream().get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadTensor(c_stream, &sp_tensor))
 *     return pyarrow_wrap_tensor(sp_tensor)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":525
 *     c_stream = nf.get_input_stream().get()
 *     with nogil:
 *         check_status(ReadTensor(c_stream, &sp_tensor))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_tensor(sp_tensor)
 * 
 */
        __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadTensor(__pyx_v_c_stream, (&__pyx_v_sp_tensor))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 525, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":524
 * 
 *     c_stream = nf.get_input_stream().get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadTensor(c_stream, &sp_tensor))
 *     return pyarrow_wrap_tensor(sp_tensor)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":526
 *     with nogil:
 *         check_status(ReadTensor(c_stream, &sp_tensor))
 *     return pyarrow_wrap_tensor(sp_tensor)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_sp_tensor); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":502
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.read_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":529
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_187read_message(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_186read_message[] = "read_message(source)\n\n    Read length-prefixed message from file or buffer-like object\n\n    Parameters\n    ----------\n    source : pyarrow.NativeFile, file-like object, or buffer-like object\n\n    Returns\n    -------\n    message : Message\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_187read_message = {"read_message", (PyCFunction)__pyx_pw_7pyarrow_3lib_187read_message, METH_O, __pyx_doc_7pyarrow_3lib_186read_message};
static PyObject *__pyx_pw_7pyarrow_3lib_187read_message(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_message (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_186read_message(__pyx_self, ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_186read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_result = 0;
  arrow::io::InputStream *__pyx_v_c_stream;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("read_message", 0);

  /* "pyarrow/ipc.pxi":542
 *     """
 *     cdef:
 *         Message result = Message.__new__(Message)             # <<<<<<<<<<<<<<
 *         InputStream* c_stream
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Message(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Message), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 542, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":545
 *         InputStream* c_stream
 * 
 *     cdef NativeFile nf = as_native_file(source)             # <<<<<<<<<<<<<<
 *     c_stream = nf.get_input_stream().get()
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_as_native_file(__pyx_v_source)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":546
 * 
 *     cdef NativeFile nf = as_native_file(source)
 *     c_stream = nf.get_input_stream().get()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_input_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 546, __pyx_L1_error)
  __pyx_v_c_stream = __pyx_t_2.get();

  /* "pyarrow/ipc.pxi":548
 *     c_stream = nf.get_input_stream().get()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":549
 * 
 *     with nogil:
 *         check_status(ReadMessage(c_stream, &result.message))             # <<<<<<<<<<<<<<
 * 
 *     if result.message == nullptr:
 */
        __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadMessage(__pyx_v_c_stream, (&__pyx_v_result->message))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 549, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":548
 *     c_stream = nf.get_input_stream().get()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":551
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 *     if result.message == nullptr:             # <<<<<<<<<<<<<<
 *         raise EOFError("End of Arrow stream")
 * 
 */
  __pyx_t_4 = ((__pyx_v_result->message == nullptr) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/ipc.pxi":552
 * 
 *     if result.message == nullptr:
 *         raise EOFError("End of Arrow stream")             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__248, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 552, __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(7, 552, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":551
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 *     if result.message == nullptr:             # <<<<<<<<<<<<<<
 *         raise EOFError("End of Arrow stream")
 * 
 */
  }

  /* "pyarrow/ipc.pxi":554
 *         raise EOFError("End of Arrow stream")
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":529
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.read_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":557
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_189read_schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_188read_schema[] = "read_schema(obj, DictionaryMemo dictionary_memo=None)\n\n    Read Schema from message or buffer\n\n    Parameters\n    ----------\n    obj : buffer or Message\n    dictionary_memo : DictionaryMemo, optional\n        Needed to be able to reconstruct dictionary-encoded fields\n        with read_record_batch\n\n    Returns\n    -------\n    schema : Schema\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_189read_schema = {"read_schema", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_189read_schema, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_188read_schema};
static PyObject *__pyx_pw_7pyarrow_3lib_189read_schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_schema (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dictionary_memo,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary_memo);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_schema") < 0)) __PYX_ERR(7, 557, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dictionary_memo = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_schema", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 557, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.read_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dictionary_memo), __pyx_ptype_7pyarrow_3lib_DictionaryMemo, 1, "dictionary_memo", 0))) __PYX_ERR(7, 557, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_188read_schema(__pyx_self, __pyx_v_obj, __pyx_v_dictionary_memo);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_188read_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo) {
  std::shared_ptr< arrow::Schema>  __pyx_v_result;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_cpp_file;
   arrow::ipc::DictionaryMemo __pyx_v_temp_memo;
   arrow::ipc::DictionaryMemo *__pyx_v_arg_dict_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
   arrow::ipc::DictionaryMemo *__pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("read_schema", 0);

  /* "pyarrow/ipc.pxi":578
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(type(obj))
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Message); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/ipc.pxi":579
 * 
 *     if isinstance(obj, Message):
 *         raise NotImplementedError(type(obj))             # <<<<<<<<<<<<<<
 * 
 *     get_reader(obj, True, &cpp_file)
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 579, __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(7, 579, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":578
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(type(obj))
 * 
 */
  }

  /* "pyarrow/ipc.pxi":581
 *         raise NotImplementedError(type(obj))
 * 
 *     get_reader(obj, True, &cpp_file)             # <<<<<<<<<<<<<<
 * 
 *     if dictionary_memo is not None:
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_obj, 1, (&__pyx_v_cpp_file)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":583
 *     get_reader(obj, True, &cpp_file)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_dictionary_memo) != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":584
 * 
 *     if dictionary_memo is not None:
 *         arg_dict_memo = dictionary_memo.memo             # <<<<<<<<<<<<<<
 *     else:
 *         arg_dict_memo = &temp_memo
 */
    __pyx_t_4 = __pyx_v_dictionary_memo->memo;
    __pyx_v_arg_dict_memo = __pyx_t_4;

    /* "pyarrow/ipc.pxi":583
 *     get_reader(obj, True, &cpp_file)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/ipc.pxi":586
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 *         arg_dict_memo = &temp_memo             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  /*else*/ {
    __pyx_v_arg_dict_memo = (&__pyx_v_temp_memo);
  }
  __pyx_L4:;

  /* "pyarrow/ipc.pxi":588
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":589
 * 
 *     with nogil:
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_schema(result)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadSchema(__pyx_v_cpp_file.get(), __pyx_v_arg_dict_memo, (&__pyx_v_result))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 589, __pyx_L6_error)
      }

      /* "pyarrow/ipc.pxi":588
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/ipc.pxi":591
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))
 * 
 *     return pyarrow_wrap_schema(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":557
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.read_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":594
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_191read_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_190read_record_batch[] = "read_record_batch(obj, Schema schema, DictionaryMemo dictionary_memo=None)\n\n    Read RecordBatch from message, given a known schema. If reading data from a\n    complete IPC stream, use ipc.open_stream instead\n\n    Parameters\n    ----------\n    obj : Message or Buffer-like\n    schema : Schema\n    dictionary_memo : DictionaryMemo, optional\n        If message contains dictionaries, must pass a populated\n        DictionaryMemo\n\n    Returns\n    -------\n    batch : RecordBatch\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_191read_record_batch = {"read_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_191read_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_190read_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_191read_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_record_batch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_schema,&__pyx_n_s_dictionary_memo,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/ipc.pxi":595
 * 
 * def read_record_batch(obj, Schema schema,
 *                       DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema. If reading data from a
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_record_batch", 0, 2, 3, 1); __PYX_ERR(7, 594, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary_memo);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_record_batch") < 0)) __PYX_ERR(7, 594, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_dictionary_memo = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_record_batch", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 594, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.read_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(7, 594, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dictionary_memo), __pyx_ptype_7pyarrow_3lib_DictionaryMemo, 1, "dictionary_memo", 0))) __PYX_ERR(7, 595, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_190read_record_batch(__pyx_self, __pyx_v_obj, __pyx_v_schema, __pyx_v_dictionary_memo);

  /* "pyarrow/ipc.pxi":594
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_190read_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_result;
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_message = 0;
   arrow::ipc::DictionaryMemo __pyx_v_temp_memo;
   arrow::ipc::DictionaryMemo *__pyx_v_arg_dict_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
   arrow::ipc::DictionaryMemo *__pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("read_record_batch", 0);

  /* "pyarrow/ipc.pxi":618
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         message = obj
 *     else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Message); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":619
 * 
 *     if isinstance(obj, Message):
 *         message = obj             # <<<<<<<<<<<<<<
 *     else:
 *         message = read_message(obj)
 */
    if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Message))))) __PYX_ERR(7, 619, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_obj;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_message = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":618
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         message = obj
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":621
 *         message = obj
 *     else:
 *         message = read_message(obj)             # <<<<<<<<<<<<<<
 * 
 *     if dictionary_memo is not None:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_read_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Message))))) __PYX_ERR(7, 621, __pyx_L1_error)
    __pyx_v_message = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":623
 *         message = read_message(obj)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_dictionary_memo) != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":624
 * 
 *     if dictionary_memo is not None:
 *         arg_dict_memo = dictionary_memo.memo             # <<<<<<<<<<<<<<
 *     else:
 *         arg_dict_memo = &temp_memo
 */
    __pyx_t_6 = __pyx_v_dictionary_memo->memo;
    __pyx_v_arg_dict_memo = __pyx_t_6;

    /* "pyarrow/ipc.pxi":623
 *         message = read_message(obj)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/ipc.pxi":626
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 *         arg_dict_memo = &temp_memo             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  /*else*/ {
    __pyx_v_arg_dict_memo = (&__pyx_v_temp_memo);
  }
  __pyx_L4:;

  /* "pyarrow/ipc.pxi":628
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadRecordBatch(deref(message.message.get()),
 *                                      schema.sp_schema,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":629
 * 
 *     with nogil:
 *         check_status(ReadRecordBatch(deref(message.message.get()),             # <<<<<<<<<<<<<<
 *                                      schema.sp_schema,
 *                                      arg_dict_memo, &result))
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadRecordBatch((*__pyx_v_message->message.get()), __pyx_v_schema->sp_schema, __pyx_v_arg_dict_memo, (&__pyx_v_result))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 629, __pyx_L6_error)
      }

      /* "pyarrow/ipc.pxi":628
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadRecordBatch(deref(message.message.get()),
 *                                      schema.sp_schema,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/ipc.pxi":633
 *                                      arg_dict_memo, &result))
 * 
 *     return pyarrow_wrap_batch(result)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":594
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.read_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_message);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":33
 *         int64_t num_rows
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.num_rows = -1
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13FeatherWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/feather.pxi":34
 * 
 *     def __cinit__(self):
 *         self.num_rows = -1             # <<<<<<<<<<<<<<
 * 
 *     def open(self, object dest):
 */
  __pyx_v_self->num_rows = -1L;

  /* "pyarrow/feather.pxi":33
 *         int64_t num_rows
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.num_rows = -1
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":36
 *         self.num_rows = -1
 * 
 *     def open(self, object dest):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[OutputStream] sink
 *         get_writer(dest, &sink)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_3open(PyObject *__pyx_v_self, PyObject *__pyx_v_dest); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_2open[] = "FeatherWriter.open(self, dest)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_3open(PyObject *__pyx_v_self, PyObject *__pyx_v_dest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_2open(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), ((PyObject *)__pyx_v_dest));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_2open(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_dest) {
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_sink;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/feather.pxi":38
 *     def open(self, object dest):
 *         cdef shared_ptr[OutputStream] sink
 *         get_writer(dest, &sink)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_dest, (&__pyx_v_sink)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":40
 *         get_writer(dest, &sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":41
 * 
 *         with nogil:
 *             check_status(CFeatherWriter.Open(sink, &self.writer))             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::feather::TableWriter::Open(__pyx_v_sink, (&__pyx_v_self->writer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(14, 41, __pyx_L4_error)
      }

      /* "pyarrow/feather.pxi":40
 *         get_writer(dest, &sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/feather.pxi":36
 *         self.num_rows = -1
 * 
 *     def open(self, object dest):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[OutputStream] sink
 *         get_writer(dest, &sink)
 */

  /* 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.lib.FeatherWriter.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":43
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.num_rows < 0:
 *             self.num_rows = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_4close[] = "FeatherWriter.close(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_4close(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_4close(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/feather.pxi":44
 * 
 *     def close(self):
 *         if self.num_rows < 0:             # <<<<<<<<<<<<<<
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 */
  __pyx_t_1 = ((__pyx_v_self->num_rows < 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/feather.pxi":45
 *     def close(self):
 *         if self.num_rows < 0:
 *             self.num_rows = 0             # <<<<<<<<<<<<<<
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:
 */
    __pyx_v_self->num_rows = 0;

    /* "pyarrow/feather.pxi":44
 * 
 *     def close(self):
 *         if self.num_rows < 0:             # <<<<<<<<<<<<<<
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 */
  }

  /* "pyarrow/feather.pxi":46
 *         if self.num_rows < 0:
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.writer.get().Finalize())
 */
  __pyx_v_self->writer.get()->SetNumRows(__pyx_v_self->num_rows);

  /* "pyarrow/feather.pxi":47
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Finalize())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":48
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:
 *             check_status(self.writer.get().Finalize())             # <<<<<<<<<<<<<<
 * 
 *     def write_array(self, object name, object col, object mask=None):
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Finalize()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(14, 48, __pyx_L5_error)
      }

      /* "pyarrow/feather.pxi":47
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Finalize())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/feather.pxi":43
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.num_rows < 0:
 *             self.num_rows = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":50
 *             check_status(self.writer.get().Finalize())
 * 
 *     def write_array(self, object name, object col, object mask=None):             # <<<<<<<<<<<<<<
 *         cdef Array arr
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_7write_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_6write_array[] = "FeatherWriter.write_array(self, name, col, mask=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_7write_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_col = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_col,&__pyx_n_s_mask,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_array", 0, 2, 3, 1); __PYX_ERR(14, 50, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_array") < 0)) __PYX_ERR(14, 50, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_col = values[1];
    __pyx_v_mask = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(14, 50, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.write_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_6write_array(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), __pyx_v_name, __pyx_v_col, __pyx_v_mask);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_6write_array(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_col, PyObject *__pyx_v_mask) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::string __pyx_v_c_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  std::string __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("write_array", 0);

  /* "pyarrow/feather.pxi":53
 *         cdef Array arr
 * 
 *         if self.num_rows >= 0:             # <<<<<<<<<<<<<<
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')
 */
  __pyx_t_1 = ((__pyx_v_self->num_rows >= 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/feather.pxi":54
 * 
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('prior column had a different number of rows')
 *         else:
 */
    __pyx_t_2 = PyObject_Length(__pyx_v_col); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(14, 54, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_2 != __pyx_v_self->num_rows) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/feather.pxi":55
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')             # <<<<<<<<<<<<<<
 *         else:
 *             self.num_rows = len(col)
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__249, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 55, __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(14, 55, __pyx_L1_error)

      /* "pyarrow/feather.pxi":54
 * 
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('prior column had a different number of rows')
 *         else:
 */
    }

    /* "pyarrow/feather.pxi":53
 *         cdef Array arr
 * 
 *         if self.num_rows >= 0:             # <<<<<<<<<<<<<<
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')
 */
    goto __pyx_L3;
  }

  /* "pyarrow/feather.pxi":57
 *                 raise ValueError('prior column had a different number of rows')
 *         else:
 *             self.num_rows = len(col)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(col, Array):
 */
  /*else*/ {
    __pyx_t_2 = PyObject_Length(__pyx_v_col); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(14, 57, __pyx_L1_error)
    __pyx_v_self->num_rows = __pyx_t_2;
  }
  __pyx_L3:;

  /* "pyarrow/feather.pxi":59
 *             self.num_rows = len(col)
 * 
 *         if isinstance(col, Array):             # <<<<<<<<<<<<<<
 *             arr = col
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_col, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/feather.pxi":60
 * 
 *         if isinstance(col, Array):
 *             arr = col             # <<<<<<<<<<<<<<
 *         else:
 *             arr = Array.from_pandas(col, mask=mask)
 */
    if (!(likely(((__pyx_v_col) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_col, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(14, 60, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_col;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/feather.pxi":59
 *             self.num_rows = len(col)
 * 
 *         if isinstance(col, Array):             # <<<<<<<<<<<<<<
 *             arr = col
 *         else:
 */
    goto __pyx_L5;
  }

  /* "pyarrow/feather.pxi":62
 *             arr = col
 *         else:
 *             arr = Array.from_pandas(col, mask=mask)             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_name = tobytes(name)
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_col);
    __Pyx_GIVEREF(__pyx_v_col);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_col);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(14, 62, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(14, 62, __pyx_L1_error)
    __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_7);
    __pyx_t_7 = 0;
  }
  __pyx_L5:;

  /* "pyarrow/feather.pxi":64
 *             arr = Array.from_pandas(col, mask=mask)
 * 
 *         cdef c_string c_name = tobytes(name)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_c_name = __pyx_t_8;

  /* "pyarrow/feather.pxi":66
 *         cdef c_string c_name = tobytes(name)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 self.writer.get().Append(c_name, deref(arr.sp_array)))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":67
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 self.writer.get().Append(c_name, deref(arr.sp_array)))
 * 
 */
        __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Append(__pyx_v_c_name, (*__pyx_v_arr->sp_array))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(14, 67, __pyx_L7_error)
      }

      /* "pyarrow/feather.pxi":66
 *         cdef c_string c_name = tobytes(name)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 self.writer.get().Append(c_name, deref(arr.sp_array)))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/feather.pxi":50
 *             check_status(self.writer.get().Finalize())
 * 
 *     def write_array(self, object name, object col, object mask=None):             # <<<<<<<<<<<<<<
 *         cdef Array arr
 * 
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.write_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":31
 * 
 *     cdef public:
 *         int64_t num_rows             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows_2__set__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows_2__set__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(14, 31, __pyx_L1_error)
  __pyx_v_self->num_rows = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.num_rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__[] = "FeatherWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__250, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__[] = "FeatherWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__251, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":75
 *         unique_ptr[CFeatherReader] reader
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13FeatherReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13FeatherReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader___cinit__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13FeatherReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":78
 *         pass
 * 
 *     def open(self, source, c_bool use_memory_map=True):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[RandomAccessFile] reader
 *         get_reader(source, use_memory_map, &reader)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_3open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_2open[] = "FeatherReader.open(self, source, bool use_memory_map=True)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_3open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  bool __pyx_v_use_memory_map;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_use_memory_map,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_memory_map);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(14, 78, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    if (values[1]) {
      __pyx_v_use_memory_map = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_use_memory_map == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(14, 78, __pyx_L3_error)
    } else {
      __pyx_v_use_memory_map = ((bool)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(14, 78, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_2open(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), __pyx_v_source, __pyx_v_use_memory_map);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_2open(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_source, bool __pyx_v_use_memory_map) {
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_reader;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/feather.pxi":80
 *     def open(self, source, c_bool use_memory_map=True):
 *         cdef shared_ptr[RandomAccessFile] reader
 *         get_reader(source, use_memory_map, &reader)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_source, __pyx_v_use_memory_map, (&__pyx_v_reader)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":82
 *         get_reader(source, use_memory_map, &reader)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherReader.Open(reader, &self.reader))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":83
 * 
 *         with nogil:
 *             check_status(CFeatherReader.Open(reader, &self.reader))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::feather::TableReader::Open(__pyx_v_reader, (&__pyx_v_self->reader))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(14, 83, __pyx_L4_error)
      }

      /* "pyarrow/feather.pxi":82
 *         get_reader(source, use_memory_map, &reader)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherReader.Open(reader, &self.reader))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/feather.pxi":78
 *         pass
 * 
 *     def open(self, source, c_bool use_memory_map=True):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[RandomAccessFile] reader
 *         get_reader(source, use_memory_map, &reader)
 */

  /* 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.lib.FeatherReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":86
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_rows()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/feather.pxi":87
 *     @property
 *     def num_rows(self):
 *         return self.reader.get().num_rows()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->reader.get()->num_rows()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":86
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_rows()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":90
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_columns()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11num_columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11num_columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_11num_columns___get__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/feather.pxi":91
 *     @property
 *     def num_columns(self):
 *         return self.reader.get().num_columns()             # <<<<<<<<<<<<<<
 * 
 *     def get_column_name(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->reader.get()->num_columns()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":90
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_columns()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.num_columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":93
 *         return self.reader.get().num_columns()
 * 
 *     def get_column_name(self, int i):             # <<<<<<<<<<<<<<
 *         cdef c_string name = self.reader.get().GetColumnName(i)
 *         return frombytes(name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_5get_column_name(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_4get_column_name[] = "FeatherReader.get_column_name(self, int i)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_5get_column_name(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_column_name (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 93, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_4get_column_name(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_4get_column_name(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i) {
  std::string __pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_column_name", 0);

  /* "pyarrow/feather.pxi":94
 * 
 *     def get_column_name(self, int i):
 *         cdef c_string name = self.reader.get().GetColumnName(i)             # <<<<<<<<<<<<<<
 *         return frombytes(name)
 * 
 */
  __pyx_v_name = __pyx_v_self->reader.get()->GetColumnName(__pyx_v_i);

  /* "pyarrow/feather.pxi":95
 *     def get_column_name(self, int i):
 *         cdef c_string name = self.reader.get().GetColumnName(i)
 *         return frombytes(name)             # <<<<<<<<<<<<<<
 * 
 *     def get_column(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(14, 95, __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/feather.pxi":93
 *         return self.reader.get().num_columns()
 * 
 *     def get_column_name(self, int i):             # <<<<<<<<<<<<<<
 *         cdef c_string name = self.reader.get().GetColumnName(i)
 *         return frombytes(name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":97
 *         return frombytes(name)
 * 
 *     def get_column(self, int i):             # <<<<<<<<<<<<<<
 *         if i < 0 or i >= self.num_columns:
 *             raise IndexError(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_7get_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_6get_column[] = "FeatherReader.get_column(self, int i)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_7get_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_column (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 97, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_6get_column(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_6get_column(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_sp_chunked_array;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("get_column", 0);

  /* "pyarrow/feather.pxi":98
 * 
 *     def get_column(self, int i):
 *         if i < 0 or i >= self.num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(i)
 * 
 */
  __pyx_t_2 = ((__pyx_v_i < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(14, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/feather.pxi":99
 *     def get_column(self, int i):
 *         if i < 0 or i >= self.num_columns:
 *             raise IndexError(i)             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(14, 99, __pyx_L1_error)

    /* "pyarrow/feather.pxi":98
 * 
 *     def get_column(self, int i):
 *         if i < 0 or i >= self.num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(i)
 * 
 */
  }

  /* "pyarrow/feather.pxi":102
 * 
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .GetColumn(i, &sp_chunked_array))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":103
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .GetColumn(i, &sp_chunked_array))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->GetColumn(__pyx_v_i, (&__pyx_v_sp_chunked_array))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 103, __pyx_L7_error)
      }

      /* "pyarrow/feather.pxi":102
 * 
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .GetColumn(i, &sp_chunked_array))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/feather.pxi":106
 *                          .GetColumn(i, &sp_chunked_array))
 * 
 *         return pyarrow_wrap_chunked_array(sp_chunked_array)             # <<<<<<<<<<<<<<
 * 
 *     def _read(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_sp_chunked_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":97
 *         return frombytes(name)
 * 
 *     def get_column(self, int i):             # <<<<<<<<<<<<<<
 *         if i < 0 or i >= self.num_columns:
 *             raise IndexError(i)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":108
 *         return pyarrow_wrap_chunked_array(sp_chunked_array)
 * 
 *     def _read(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_8_read[] = "FeatherReader._read(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_read", 0);

  /* "pyarrow/feather.pxi":110
 *     def _read(self):
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(&sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":111
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(&sp_table))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read((&__pyx_v_sp_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(14, 111, __pyx_L4_error)
      }

      /* "pyarrow/feather.pxi":110
 *     def _read(self):
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(&sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/feather.pxi":114
 *                          .Read(&sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 * 
 *     def _read_indices(self, indices):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":108
 *         return pyarrow_wrap_chunked_array(sp_chunked_array)
 * 
 *     def _read(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":116
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_indices(self, indices):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices(PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_10_read_indices[] = "FeatherReader._read_indices(self, indices)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices(PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_indices (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v_indices));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_indices) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  std::vector<int>  __pyx_v_c_indices;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_read_indices", 0);

  /* "pyarrow/feather.pxi":121
 *             vector[int] c_indices
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             c_indices.push_back(index)
 *         with nogil:
 */
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_1 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 121, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 121, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 121, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(14, 121, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/feather.pxi":122
 * 
 *         for index in indices:
 *             c_indices.push_back(index)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.reader.get()
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 122, __pyx_L1_error)
    try {
      __pyx_v_c_indices.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(14, 122, __pyx_L1_error)
    }

    /* "pyarrow/feather.pxi":121
 *             vector[int] c_indices
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             c_indices.push_back(index)
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":123
 *         for index in indices:
 *             c_indices.push_back(index)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_indices, &sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":124
 *             c_indices.push_back(index)
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(c_indices, &sp_table))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read(__pyx_v_c_indices, (&__pyx_v_sp_table))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 124, __pyx_L6_error)
      }

      /* "pyarrow/feather.pxi":123
 *         for index in indices:
 *             c_indices.push_back(index)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_indices, &sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/feather.pxi":127
 *                          .Read(c_indices, &sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 * 
 *     def _read_names(self, names):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":116
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_indices(self, indices):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":129
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_names(self, names):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names(PyObject *__pyx_v_self, PyObject *__pyx_v_names); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_12_read_names[] = "FeatherReader._read_names(self, names)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names(PyObject *__pyx_v_self, PyObject *__pyx_v_names) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_names (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v_names));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_names) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  std::vector<std::string>  __pyx_v_c_names;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_read_names", 0);

  /* "pyarrow/feather.pxi":134
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 */
  if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
    __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 134, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 134, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 134, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(14, 134, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/feather.pxi":135
 * 
 *         for name in names:
 *             c_names.push_back(tobytes(name))             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.reader.get()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 135, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    try {
      __pyx_v_c_names.push_back(__pyx_t_7);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(14, 135, __pyx_L1_error)
    }

    /* "pyarrow/feather.pxi":134
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":136
 *         for name in names:
 *             c_names.push_back(tobytes(name))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_names, &sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":137
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(c_names, &sp_table))
 * 
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read(__pyx_v_c_names, (&__pyx_v_sp_table))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(14, 137, __pyx_L6_error)
      }

      /* "pyarrow/feather.pxi":136
 *         for name in names:
 *             c_names.push_back(tobytes(name))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_names, &sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/feather.pxi":140
 *                          .Read(c_names, &sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":129
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_names(self, names):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_14__reduce_cython__[] = "FeatherReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__252, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_16__setstate_cython__[] = "FeatherReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__253, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_193is_named_tuple(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static char __pyx_doc_7pyarrow_3lib_192is_named_tuple[] = "is_named_tuple(cls)\nReturn True if cls is a namedtuple and False otherwise.";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_193is_named_tuple = {"is_named_tuple", (PyCFunction)__pyx_pw_7pyarrow_3lib_193is_named_tuple, METH_O, __pyx_doc_7pyarrow_3lib_192is_named_tuple};
static PyObject *__pyx_pw_7pyarrow_3lib_193is_named_tuple(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_named_tuple (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_192is_named_tuple(__pyx_self, ((PyObject *)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_14is_named_tuple_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/serialization.pxi":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */

static PyObject *__pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15_genexpr(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(15, 33, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_14is_named_tuple_2generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_named_tuple_locals_genexpr, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(15, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.is_named_tuple.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_14is_named_tuple_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(15, 33, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(15, 33, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 33, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(15, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(15, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(15, 33, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_n, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(15, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
    if (__pyx_t_7) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

static PyObject *__pyx_pf_7pyarrow_3lib_192is_named_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *__pyx_cur_scope;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("is_named_tuple", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(15, 25, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/serialization.pxi":27
 * def is_named_tuple(cls):
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__             # <<<<<<<<<<<<<<
 *     if len(b) != 1 or b[0] != tuple:
 *         return False
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_b = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":28
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:             # <<<<<<<<<<<<<<
 *         return False
 *     f = getattr(cls, "_fields", None)
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(15, 28, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 != 1) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)(&PyTuple_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(15, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":29
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:
 *         return False             # <<<<<<<<<<<<<<
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/serialization.pxi":28
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:             # <<<<<<<<<<<<<<
 *         return False
 *     f = getattr(cls, "_fields", None)
 */
  }

  /* "pyarrow/serialization.pxi":30
 *     if len(b) != 1 or b[0] != tuple:
 *         return False
 *     f = getattr(cls, "_fields", None)             # <<<<<<<<<<<<<<
 *     if not isinstance(f, tuple):
 *         return False
 */
  __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_n_u_fields_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_f = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/serialization.pxi":31
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_f;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":32
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):
 *         return False             # <<<<<<<<<<<<<<
 *     return all(isinstance(n, six.string_types) for n in f)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/serialization.pxi":31
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)
 */
  }

  /* "pyarrow/serialization.pxi":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.is_named_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_26SerializationCallbackError___init__[] = "SerializationCallbackError.__init__(self, message, example_object)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_26SerializationCallbackError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_26SerializationCallbackError___init__};
static PyObject *__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_example_object = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_example_object,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(15, 37, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_example_object)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(15, 37, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(15, 37, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_example_object = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 37, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_example_object);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_example_object) {
  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 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":38
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)             # <<<<<<<<<<<<<<
 *         self.example_object = example_object
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 38, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 38, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":39
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_example_object, __pyx_v_example_object) < 0) __PYX_ERR(15, 39, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_28DeserializationCallbackError___init__[] = "DeserializationCallbackError.__init__(self, message, type_id)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_28DeserializationCallbackError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_28DeserializationCallbackError___init__};
static PyObject *__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_type_id = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_type_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(15, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(15, 43, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(15, 43, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_type_id = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 43, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.DeserializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_type_id);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_type_id) {
  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 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":44
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)             # <<<<<<<<<<<<<<
 *         self.type_id = type_id
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 44, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 44, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":45
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type_id, __pyx_v_type_id) < 0) __PYX_ERR(15, 45, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.DeserializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":58
 *         object pickle_deserializer
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":60
 *     def __init__(self):
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()             # <<<<<<<<<<<<<<
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type_to_type_id);
  __Pyx_DECREF(__pyx_v_self->type_to_type_id);
  __pyx_v_self->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":61
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 *         self.whitelisted_types = dict()             # <<<<<<<<<<<<<<
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->whitelisted_types);
  __Pyx_DECREF(__pyx_v_self->whitelisted_types);
  __pyx_v_self->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":62
 *         self.type_to_type_id = dict()
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()             # <<<<<<<<<<<<<<
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->types_to_pickle);
  __Pyx_DECREF(__pyx_v_self->types_to_pickle);
  __pyx_v_self->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":63
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()             # <<<<<<<<<<<<<<
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->custom_serializers);
  __Pyx_DECREF(__pyx_v_self->custom_serializers);
  __pyx_v_self->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":64
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()             # <<<<<<<<<<<<<<
 *         self.pickle_serializer = pickle.dumps
 *         self.pickle_deserializer = pickle.loads
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->custom_deserializers);
  __Pyx_DECREF(__pyx_v_self->custom_deserializers);
  __pyx_v_self->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":65
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps             # <<<<<<<<<<<<<<
 *         self.pickle_deserializer = pickle.loads
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->pickle_serializer);
  __Pyx_DECREF(__pyx_v_self->pickle_serializer);
  __pyx_v_self->pickle_serializer = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":66
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps
 *         self.pickle_deserializer = pickle.loads             # <<<<<<<<<<<<<<
 * 
 *     def set_pickle(self, serializer, deserializer):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_self->pickle_deserializer);
  __pyx_v_self->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":58
 *         object pickle_deserializer
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":68
 *         self.pickle_deserializer = pickle.loads
 * 
 *     def set_pickle(self, serializer, deserializer):             # <<<<<<<<<<<<<<
 *         """
 *         Set the serializer and deserializer to use for objects that are to be
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_2set_pickle[] = "SerializationContext.set_pickle(self, serializer, deserializer)\n\n        Set the serializer and deserializer to use for objects that are to be\n        pickled.\n\n        Parameters\n        ----------\n        serializer : callable\n            The serializer to use (e.g., pickle.dumps or cloudpickle.dumps).\n        deserializer : callable\n            The deserializer to use (e.g., pickle.dumps or cloudpickle.dumps).\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_serializer = 0;
  PyObject *__pyx_v_deserializer = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pickle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_serializer,&__pyx_n_s_deserializer,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serializer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deserializer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_pickle", 1, 2, 2, 1); __PYX_ERR(15, 68, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_pickle") < 0)) __PYX_ERR(15, 68, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_serializer = values[0];
    __pyx_v_deserializer = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_pickle", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 68, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.set_pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_serializer, __pyx_v_deserializer);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serializer, PyObject *__pyx_v_deserializer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pickle", 0);

  /* "pyarrow/serialization.pxi":80
 *             The deserializer to use (e.g., pickle.dumps or cloudpickle.dumps).
 *         """
 *         self.pickle_serializer = serializer             # <<<<<<<<<<<<<<
 *         self.pickle_deserializer = deserializer
 * 
 */
  __Pyx_INCREF(__pyx_v_serializer);
  __Pyx_GIVEREF(__pyx_v_serializer);
  __Pyx_GOTREF(__pyx_v_self->pickle_serializer);
  __Pyx_DECREF(__pyx_v_self->pickle_serializer);
  __pyx_v_self->pickle_serializer = __pyx_v_serializer;

  /* "pyarrow/serialization.pxi":81
 *         """
 *         self.pickle_serializer = serializer
 *         self.pickle_deserializer = deserializer             # <<<<<<<<<<<<<<
 * 
 *     def clone(self):
 */
  __Pyx_INCREF(__pyx_v_deserializer);
  __Pyx_GIVEREF(__pyx_v_deserializer);
  __Pyx_GOTREF(__pyx_v_self->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_self->pickle_deserializer);
  __pyx_v_self->pickle_deserializer = __pyx_v_deserializer;

  /* "pyarrow/serialization.pxi":68
 *         self.pickle_deserializer = pickle.loads
 * 
 *     def set_pickle(self, serializer, deserializer):             # <<<<<<<<<<<<<<
 *         """
 *         Set the serializer and deserializer to use for objects that are to be
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":83
 *         self.pickle_deserializer = deserializer
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return copy of this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_4clone[] = "SerializationContext.clone(self)\n\n        Return copy of this SerializationContext\n\n        Returns\n        -------\n        clone : SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "pyarrow/serialization.pxi":91
 *         clone : SerializationContext
 *         """
 *         result = SerializationContext()             # <<<<<<<<<<<<<<
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":92
 *         """
 *         result = SerializationContext()
 *         result.type_to_type_id = self.type_to_type_id.copy()             # <<<<<<<<<<<<<<
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->type_to_type_id, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->type_to_type_id);
  __Pyx_DECREF(__pyx_v_result->type_to_type_id);
  __pyx_v_result->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":93
 *         result = SerializationContext()
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()             # <<<<<<<<<<<<<<
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->whitelisted_types, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->whitelisted_types);
  __Pyx_DECREF(__pyx_v_result->whitelisted_types);
  __pyx_v_result->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":94
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()             # <<<<<<<<<<<<<<
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->types_to_pickle, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->types_to_pickle);
  __Pyx_DECREF(__pyx_v_result->types_to_pickle);
  __pyx_v_result->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":95
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()             # <<<<<<<<<<<<<<
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->custom_serializers, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->custom_serializers);
  __Pyx_DECREF(__pyx_v_result->custom_serializers);
  __pyx_v_result->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":96
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()             # <<<<<<<<<<<<<<
 *         result.pickle_serializer = self.pickle_serializer
 *         result.pickle_deserializer = self.pickle_deserializer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->custom_deserializers, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->custom_deserializers);
  __Pyx_DECREF(__pyx_v_result->custom_deserializers);
  __pyx_v_result->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":97
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer             # <<<<<<<<<<<<<<
 *         result.pickle_deserializer = self.pickle_deserializer
 * 
 */
  __pyx_t_1 = __pyx_v_self->pickle_serializer;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->pickle_serializer);
  __Pyx_DECREF(__pyx_v_result->pickle_serializer);
  __pyx_v_result->pickle_serializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":98
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer
 *         result.pickle_deserializer = self.pickle_deserializer             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __pyx_v_self->pickle_deserializer;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_result->pickle_deserializer);
  __pyx_v_result->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":100
 *         result.pickle_deserializer = self.pickle_deserializer
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def register_type(self, type_, type_id, pickle=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":83
 *         self.pickle_deserializer = deserializer
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return copy of this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.clone", __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/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_7register_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_6register_type[] = "SerializationContext.register_type(self, type_, type_id, pickle=False, custom_serializer=None, custom_deserializer=None)\nEXPERIMENTAL: Add type to the list of types we can serialize.\n\n        Parameters\n        ----------\n        type\\_ : type\n            The type that we can serialize.\n        type_id : string\n            A string used to identify the type.\n        pickle : bool\n            True if the serialization should be done with pickle.\n            False if it should be done efficiently with Arrow.\n        custom_serializer : callable\n            This argument is optional, but can be provided to\n            serialize objects of the class in a particular way.\n        custom_deserializer : callable\n            This argument is optional, but can be provided to\n            deserialize objects of the class in a particular way.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_7register_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type_ = 0;
  PyObject *__pyx_v_type_id = 0;
  PyObject *__pyx_v_pickle = 0;
  PyObject *__pyx_v_custom_serializer = 0;
  PyObject *__pyx_v_custom_deserializer = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type_3,&__pyx_n_s_type_id,&__pyx_n_s_pickle,&__pyx_n_s_custom_serializer,&__pyx_n_s_custom_deserializer,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)Py_False);

    /* "pyarrow/serialization.pxi":103
 * 
 *     def register_type(self, type_, type_id, pickle=False,
 *                       custom_serializer=None, custom_deserializer=None):             # <<<<<<<<<<<<<<
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 * 
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_3)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_type", 0, 2, 5, 1); __PYX_ERR(15, 102, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pickle);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_serializer);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_deserializer);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_type") < 0)) __PYX_ERR(15, 102, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_type_ = values[0];
    __pyx_v_type_id = values[1];
    __pyx_v_pickle = values[2];
    __pyx_v_custom_serializer = values[3];
    __pyx_v_custom_deserializer = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_type", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 102, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.register_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_type_, __pyx_v_type_id, __pyx_v_pickle, __pyx_v_custom_serializer, __pyx_v_custom_deserializer);

  /* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_type_, PyObject *__pyx_v_type_id, PyObject *__pyx_v_pickle, PyObject *__pyx_v_custom_serializer, PyObject *__pyx_v_custom_deserializer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("register_type", 0);

  /* "pyarrow/serialization.pxi":122
 *             deserialize objects of the class in a particular way.
 *         """
 *         if not isinstance(type_id, six.string_types):             # <<<<<<<<<<<<<<
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_type_id, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(15, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/serialization.pxi":124
 *         if not isinstance(type_id, six.string_types):
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))             # <<<<<<<<<<<<<<
 * 
 *         self.type_to_type_id[type_] = type_id
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_type_id_argument_must_be_a_s, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_type_id))) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_v_type_id)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":123
 *         """
 *         if not isinstance(type_id, six.string_types):
 *             raise TypeError("The type_id argument must be a string. The value "             # <<<<<<<<<<<<<<
 *                             "passed in has type {}.".format(type(type_id)))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(15, 123, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":122
 *             deserialize objects of the class in a particular way.
 *         """
 *         if not isinstance(type_id, six.string_types):             # <<<<<<<<<<<<<<
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))
 */
  }

  /* "pyarrow/serialization.pxi":126
 *                             "passed in has type {}.".format(type(type_id)))
 * 
 *         self.type_to_type_id[type_] = type_id             # <<<<<<<<<<<<<<
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:
 */
  if (unlikely(PyObject_SetItem(__pyx_v_self->type_to_type_id, __pyx_v_type_, __pyx_v_type_id) < 0)) __PYX_ERR(15, 126, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":127
 * 
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_             # <<<<<<<<<<<<<<
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 */
  if (unlikely(PyObject_SetItem(__pyx_v_self->whitelisted_types, __pyx_v_type_id, __pyx_v_type_) < 0)) __PYX_ERR(15, 127, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":128
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:             # <<<<<<<<<<<<<<
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_pickle); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(15, 128, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":129
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:
 *             self.types_to_pickle.add(type_id)             # <<<<<<<<<<<<<<
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->types_to_pickle, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_type_id) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_type_id);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":128
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:             # <<<<<<<<<<<<<<
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 */
  }

  /* "pyarrow/serialization.pxi":130
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:             # <<<<<<<<<<<<<<
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer
 */
  __pyx_t_4 = (__pyx_v_custom_serializer != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":131
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer             # <<<<<<<<<<<<<<
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 */
    if (unlikely(PyObject_SetItem(__pyx_v_self->custom_serializers, __pyx_v_type_id, __pyx_v_custom_serializer) < 0)) __PYX_ERR(15, 131, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":132
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer             # <<<<<<<<<<<<<<
 * 
 *     def _serialize_callback(self, obj):
 */
    if (unlikely(PyObject_SetItem(__pyx_v_self->custom_deserializers, __pyx_v_type_id, __pyx_v_custom_deserializer) < 0)) __PYX_ERR(15, 132, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":130
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:             # <<<<<<<<<<<<<<
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer
 */
  }

  /* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.register_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":134
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 *     def _serialize_callback(self, obj):             # <<<<<<<<<<<<<<
 *         found = False
 *         for type_ in type(obj).__mro__:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_8_serialize_callback[] = "SerializationContext._serialize_callback(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_serialize_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_v_found;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_v_type_id = NULL;
  PyObject *__pyx_v_serialized_obj = NULL;
  PyObject *__pyx_v_msg = 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)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("_serialize_callback", 0);

  /* "pyarrow/serialization.pxi":135
 * 
 *     def _serialize_callback(self, obj):
 *         found = False             # <<<<<<<<<<<<<<
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:
 */
  __pyx_v_found = 0;

  /* "pyarrow/serialization.pxi":136
 *     def _serialize_callback(self, obj):
 *         found = False
 *         for type_ in type(obj).__mro__:             # <<<<<<<<<<<<<<
 *             if type_ in self.type_to_type_id:
 *                 found = True
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_mro); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 136, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(15, 136, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(15, 136, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(15, 136, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":137
 *         found = False
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:             # <<<<<<<<<<<<<<
 *                 found = True
 *                 break
 */
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_, __pyx_v_self->type_to_type_id, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(15, 137, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":138
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:
 *                 found = True             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_v_found = 1;

      /* "pyarrow/serialization.pxi":139
 *             if type_ in self.type_to_type_id:
 *                 found = True
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if not found:
 */
      goto __pyx_L4_break;

      /* "pyarrow/serialization.pxi":137
 *         found = False
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:             # <<<<<<<<<<<<<<
 *                 found = True
 *                 break
 */
    }

    /* "pyarrow/serialization.pxi":136
 *     def _serialize_callback(self, obj):
 *         found = False
 *         for type_ in type(obj).__mro__:             # <<<<<<<<<<<<<<
 *             if type_ in self.type_to_type_id:
 *                 found = True
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":141
 *                 break
 * 
 *         if not found:             # <<<<<<<<<<<<<<
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 */
  __pyx_t_6 = ((!(__pyx_v_found != 0)) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/serialization.pxi":142
 * 
 *         if not found:
 *             raise SerializationCallbackError(             # <<<<<<<<<<<<<<
 *                 "pyarrow does not know how to "
 *                 "serialize objects of type {}.".format(type(obj)), obj
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SerializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/serialization.pxi":144
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 *                 "serialize objects of type {}.".format(type(obj)), obj             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_does_not_know_how_to_ser, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, ((PyObject *)Py_TYPE(__pyx_v_obj))) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)Py_TYPE(__pyx_v_obj)));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_obj};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 142, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_obj};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 142, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_7);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_v_obj);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(15, 142, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":141
 *                 break
 * 
 *         if not found:             # <<<<<<<<<<<<<<
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 */
  }

  /* "pyarrow/serialization.pxi":148
 * 
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]             # <<<<<<<<<<<<<<
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 */
  if (unlikely(!__pyx_v_type_)) { __Pyx_RaiseUnboundLocalError("type_"); __PYX_ERR(15, 148, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->type_to_type_id, __pyx_v_type_); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_type_id = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":149
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 */
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->types_to_pickle, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(15, 149, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":150
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),             # <<<<<<<<<<<<<<
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_self->pickle_serializer);
    __pyx_t_9 = __pyx_v_self->pickle_serializer; __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_data, __pyx_t_1) < 0) __PYX_ERR(15, 150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":151
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}             # <<<<<<<<<<<<<<
 *         elif type_id in self.custom_serializers:
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_pickle, Py_True) < 0) __PYX_ERR(15, 150, __pyx_L1_error)
    __pyx_v_serialized_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":149
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 */
    goto __pyx_L7;
  }

  /* "pyarrow/serialization.pxi":152
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 */
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->custom_serializers, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(15, 152, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/serialization.pxi":153
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}             # <<<<<<<<<<<<<<
 *         else:
 *             if is_named_tuple(type_):
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_self->custom_serializers, __pyx_v_type_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_data, __pyx_t_1) < 0) __PYX_ERR(15, 153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_serialized_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":152
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/serialization.pxi":155
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 *             if is_named_tuple(type_):             # <<<<<<<<<<<<<<
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_named_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_v_type_)) { __Pyx_RaiseUnboundLocalError("type_"); __PYX_ERR(15, 155, __pyx_L1_error) }
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_type_) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_type_);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(15, 155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":156
 *         else:
 *             if is_named_tuple(type_):
 *                 serialized_obj = {}             # <<<<<<<<<<<<<<
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":157
 *             if is_named_tuple(type_):
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()             # <<<<<<<<<<<<<<
 *             elif hasattr(obj, "__dict__"):
 *                 serialized_obj = obj.__dict__
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_getnewargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_serialized_obj, __pyx_n_u_pa_getnewargs, __pyx_t_2) < 0)) __PYX_ERR(15, 157, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":155
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 *             if is_named_tuple(type_):             # <<<<<<<<<<<<<<
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 */
      goto __pyx_L8;
    }

    /* "pyarrow/serialization.pxi":158
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):             # <<<<<<<<<<<<<<
 *                 serialized_obj = obj.__dict__
 *             else:
 */
    __pyx_t_6 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(15, 158, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (likely(__pyx_t_5)) {

      /* "pyarrow/serialization.pxi":159
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):
 *                 serialized_obj = obj.__dict__             # <<<<<<<<<<<<<<
 *             else:
 *                 msg = "We do not know how to serialize " \
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":158
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):             # <<<<<<<<<<<<<<
 *                 serialized_obj = obj.__dict__
 *             else:
 */
      goto __pyx_L8;
    }

    /* "pyarrow/serialization.pxi":161
 *                 serialized_obj = obj.__dict__
 *             else:
 *                 msg = "We do not know how to serialize " \             # <<<<<<<<<<<<<<
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)
 */
    /*else*/ {

      /* "pyarrow/serialization.pxi":162
 *             else:
 *                 msg = "We do not know how to serialize " \
 *                       "the object '{}'".format(obj)             # <<<<<<<<<<<<<<
 *                 raise SerializationCallbackError(msg, obj)
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_We_do_not_know_how_to_serialize, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_obj);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_msg = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":163
 *                 msg = "We do not know how to serialize " \
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)             # <<<<<<<<<<<<<<
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SerializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_msg, __pyx_v_obj};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_msg, __pyx_v_obj};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_msg);
        __Pyx_GIVEREF(__pyx_v_msg);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_msg);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_v_obj);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(15, 163, __pyx_L1_error)
    }
    __pyx_L8:;
  }
  __pyx_L7:;

  /* "pyarrow/serialization.pxi":164
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)
 *         return dict(serialized_obj, **{"_pytype_": type_id})             # <<<<<<<<<<<<<<
 * 
 *     def _deserialize_callback(self, serialized_obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_serialized_obj);
  __Pyx_GIVEREF(__pyx_v_serialized_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_serialized_obj);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pytype, __pyx_v_type_id) < 0) __PYX_ERR(15, 164, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":134
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 *     def _serialize_callback(self, obj):             # <<<<<<<<<<<<<<
 *         found = False
 *         for type_ in type(obj).__mro__:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext._serialize_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XDECREF(__pyx_v_type_id);
  __Pyx_XDECREF(__pyx_v_serialized_obj);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":166
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_10_deserialize_callback[] = "SerializationContext._deserialize_callback(self, serialized_obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_deserialize_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_serialized_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serialized_obj) {
  PyObject *__pyx_v_type_id = NULL;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_deserialize_callback", 0);

  /* "pyarrow/serialization.pxi":167
 * 
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]             # <<<<<<<<<<<<<<
 *         if isinstance(type_id, bytes):
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_pytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":168
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):             # <<<<<<<<<<<<<<
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 *             type_id = frombytes(type_id)
 */
  __pyx_t_2 = PyBytes_Check(__pyx_v_type_id); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":170
 *         if isinstance(type_id, bytes):
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 *             type_id = frombytes(type_id)             # <<<<<<<<<<<<<<
 * 
 *         if "pickle" in serialized_obj:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_type_id) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_type_id);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_type_id, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":168
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):             # <<<<<<<<<<<<<<
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 *             type_id = frombytes(type_id)
 */
  }

  /* "pyarrow/serialization.pxi":172
 *             type_id = frombytes(type_id)
 * 
 *         if "pickle" in serialized_obj:             # <<<<<<<<<<<<<<
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 */
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_pickle, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(15, 172, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":174
 *         if "pickle" in serialized_obj:
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])             # <<<<<<<<<<<<<<
 *         else:
 *             assert type_id not in self.types_to_pickle
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->pickle_deserializer);
    __pyx_t_5 = __pyx_v_self->pickle_deserializer; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":172
 *             type_id = frombytes(type_id)
 * 
 *         if "pickle" in serialized_obj:             # <<<<<<<<<<<<<<
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 */
    goto __pyx_L4;
  }

  /* "pyarrow/serialization.pxi":176
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 *         else:
 *             assert type_id not in self.types_to_pickle             # <<<<<<<<<<<<<<
 *             if type_id not in self.whitelisted_types:
 *                 msg = "Type ID " + type_id + " not registered in " \
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->types_to_pickle, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(15, 176, __pyx_L1_error)
      if (unlikely(!(__pyx_t_2 != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(15, 176, __pyx_L1_error)
      }
    }
    #endif

    /* "pyarrow/serialization.pxi":177
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 */
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->whitelisted_types, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(15, 177, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/serialization.pxi":178
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:
 *                 msg = "Type ID " + type_id + " not registered in " \             # <<<<<<<<<<<<<<
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)
 */
      __pyx_t_1 = PyNumber_Add(__pyx_kp_u_Type_ID, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_not_registered_in_deserializati); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_msg = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/serialization.pxi":180
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)             # <<<<<<<<<<<<<<
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DeserializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_v_type_id};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 180, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_v_type_id};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 180, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_msg);
        __Pyx_GIVEREF(__pyx_v_msg);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_msg);
        __Pyx_INCREF(__pyx_v_type_id);
        __Pyx_GIVEREF(__pyx_v_type_id);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_type_id);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(15, 180, __pyx_L1_error)

      /* "pyarrow/serialization.pxi":177
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 */
    }

    /* "pyarrow/serialization.pxi":181
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)
 *             type_ = self.whitelisted_types[type_id]             # <<<<<<<<<<<<<<
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](
 */
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_self->whitelisted_types, __pyx_v_type_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_type_ = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/serialization.pxi":182
 *                 raise DeserializationCallbackError(msg, type_id)
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:             # <<<<<<<<<<<<<<
 *                 obj = self.custom_deserializers[type_id](
 *                     serialized_obj["data"])
 */
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->custom_deserializers, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(15, 182, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/serialization.pxi":183
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](             # <<<<<<<<<<<<<<
 *                     serialized_obj["data"])
 *             else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->custom_deserializers, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/serialization.pxi":184
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](
 *                     serialized_obj["data"])             # <<<<<<<<<<<<<<
 *             else:
 *                 # In this case, serialized_obj should just be
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_obj = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/serialization.pxi":182
 *                 raise DeserializationCallbackError(msg, type_id)
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:             # <<<<<<<<<<<<<<
 *                 obj = self.custom_deserializers[type_id](
 *                     serialized_obj["data"])
 */
      goto __pyx_L6;
    }

    /* "pyarrow/serialization.pxi":188
 *                 # In this case, serialized_obj should just be
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:             # <<<<<<<<<<<<<<
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 */
    /*else*/ {
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_pa_getnewargs, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(15, 188, __pyx_L1_error)
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "pyarrow/serialization.pxi":189
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(             # <<<<<<<<<<<<<<
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_, __pyx_n_s_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "pyarrow/serialization.pxi":190
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])             # <<<<<<<<<<<<<<
 *                 else:
 *                     obj = type_.__new__(type_)
 */
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_type_);
        __Pyx_GIVEREF(__pyx_v_type_);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_type_);
        __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_pa_getnewargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "pyarrow/serialization.pxi":189
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(             # <<<<<<<<<<<<<<
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 */
        __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_obj = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":188
 *                 # In this case, serialized_obj should just be
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:             # <<<<<<<<<<<<<<
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 */
        goto __pyx_L7;
      }

      /* "pyarrow/serialization.pxi":192
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 *                     obj = type_.__new__(type_)             # <<<<<<<<<<<<<<
 *                     serialized_obj.pop("_pytype_")
 *                     obj.__dict__.update(serialized_obj)
 */
      /*else*/ {
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_, __pyx_n_s_new); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_type_) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_type_);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_obj = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":193
 *                 else:
 *                     obj = type_.__new__(type_)
 *                     serialized_obj.pop("_pytype_")             # <<<<<<<<<<<<<<
 *                     obj.__dict__.update(serialized_obj)
 *         return obj
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized_obj, __pyx_n_s_pop); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_u_pytype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_pytype);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":194
 *                     obj = type_.__new__(type_)
 *                     serialized_obj.pop("_pytype_")
 *                     obj.__dict__.update(serialized_obj)             # <<<<<<<<<<<<<<
 *         return obj
 * 
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_serialized_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_serialized_obj);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L7:;
    }
    __pyx_L6:;
  }
  __pyx_L4:;

  /* "pyarrow/serialization.pxi":195
 *                     serialized_obj.pop("_pytype_")
 *                     obj.__dict__.update(serialized_obj)
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":166
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext._deserialize_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_id);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":197
 *         return obj
 * 
 *     def serialize(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_13serialize(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_12serialize[] = "SerializationContext.serialize(self, obj)\n\n        Call pyarrow.serialize and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_13serialize(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_12serialize(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_12serialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/serialization.pxi":201
 *         Call pyarrow.serialize and pass this SerializationContext
 *         """
 *         return serialize(obj, context=self)             # <<<<<<<<<<<<<<
 * 
 *     def serialize_to(self, object value, sink):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(15, 201, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":197
 *         return obj
 * 
 *     def serialize(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize and pass this SerializationContext
 */

  /* 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.lib.SerializationContext.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":203
 *         return serialize(obj, context=self)
 * 
 *     def serialize_to(self, object value, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize_to and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_15serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_14serialize_to[] = "SerializationContext.serialize_to(self, value, sink)\n\n        Call pyarrow.serialize_to and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_15serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_sink = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize_to (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_sink,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("serialize_to", 1, 2, 2, 1); __PYX_ERR(15, 203, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize_to") < 0)) __PYX_ERR(15, 203, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_value = values[0];
    __pyx_v_sink = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize_to", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 203, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_14serialize_to(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_value, __pyx_v_sink);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_14serialize_to(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("serialize_to", 0);

  /* "pyarrow/serialization.pxi":207
 *         Call pyarrow.serialize_to and pass this SerializationContext
 *         """
 *         return serialize_to(value, sink, context=self)             # <<<<<<<<<<<<<<
 * 
 *     def deserialize(self, what):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_sink);
  __Pyx_GIVEREF(__pyx_v_sink);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_sink);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(15, 207, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":203
 *         return serialize(obj, context=self)
 * 
 *     def serialize_to(self, object value, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize_to and pass this SerializationContext
 */

  /* 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.lib.SerializationContext.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":209
 *         return serialize_to(value, sink, context=self)
 * 
 *     def deserialize(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_17deserialize(PyObject *__pyx_v_self, PyObject *__pyx_v_what); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_16deserialize[] = "SerializationContext.deserialize(self, what)\n\n        Call pyarrow.deserialize and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_17deserialize(PyObject *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_16deserialize(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_what));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_16deserialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/serialization.pxi":213
 *         Call pyarrow.deserialize and pass this SerializationContext
 *         """
 *         return deserialize(what, context=self)             # <<<<<<<<<<<<<<
 * 
 *     def deserialize_components(self, what):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_deserialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_what);
  __Pyx_GIVEREF(__pyx_v_what);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_what);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(15, 213, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":209
 *         return serialize_to(value, sink, context=self)
 * 
 *     def deserialize(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize and pass this SerializationContext
 */

  /* 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.lib.SerializationContext.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":215
 *         return deserialize(what, context=self)
 * 
 *     def deserialize_components(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize_components and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_19deserialize_components(PyObject *__pyx_v_self, PyObject *__pyx_v_what); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_18deserialize_components[] = "SerializationContext.deserialize_components(self, what)\n\n        Call pyarrow.deserialize_components and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_19deserialize_components(PyObject *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize_components (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_18deserialize_components(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_what));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_18deserialize_components(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("deserialize_components", 0);

  /* "pyarrow/serialization.pxi":219
 *         Call pyarrow.deserialize_components and pass this SerializationContext
 *         """
 *         return deserialize_components(what, context=self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_deserialize_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_what);
  __Pyx_GIVEREF(__pyx_v_what);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_what);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(15, 219, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":215
 *         return deserialize(what, context=self)
 * 
 *     def deserialize_components(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize_components and pass this SerializationContext
 */

  /* 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.lib.SerializationContext.deserialize_components", __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_3lib_20SerializationContext_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_20__reduce_cython__[] = "SerializationContext.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->custom_deserializers);
  __Pyx_GIVEREF(__pyx_v_self->custom_deserializers);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->custom_deserializers);
  __Pyx_INCREF(__pyx_v_self->custom_serializers);
  __Pyx_GIVEREF(__pyx_v_self->custom_serializers);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->custom_serializers);
  __Pyx_INCREF(__pyx_v_self->pickle_deserializer);
  __Pyx_GIVEREF(__pyx_v_self->pickle_deserializer);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->pickle_deserializer);
  __Pyx_INCREF(__pyx_v_self->pickle_serializer);
  __Pyx_GIVEREF(__pyx_v_self->pickle_serializer);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->pickle_serializer);
  __Pyx_INCREF(__pyx_v_self->type_to_type_id);
  __Pyx_GIVEREF(__pyx_v_self->type_to_type_id);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->type_to_type_id);
  __Pyx_INCREF(__pyx_v_self->types_to_pickle);
  __Pyx_GIVEREF(__pyx_v_self->types_to_pickle);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->types_to_pickle);
  __Pyx_INCREF(__pyx_v_self->whitelisted_types);
  __Pyx_GIVEREF(__pyx_v_self->whitelisted_types);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_self->whitelisted_types);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 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:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->custom_deserializers != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->custom_serializers != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->pickle_deserializer != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->pickle_serializer != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->type_to_type_id != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->types_to_pickle != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->whitelisted_types != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_SerializationCont); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_162458991);
    __Pyx_GIVEREF(__pyx_int_162458991);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_162458991);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_SerializationCont); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_162458991);
    __Pyx_GIVEREF(__pyx_int_162458991);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_162458991);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 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_6);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__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_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_22__setstate_cython__[] = "SerializationContext.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_195_get_default_context(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_194_get_default_context[] = "_get_default_context()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_195_get_default_context = {"_get_default_context", (PyCFunction)__pyx_pw_7pyarrow_3lib_195_get_default_context, METH_NOARGS, __pyx_doc_7pyarrow_3lib_194_get_default_context};
static PyObject *__pyx_pw_7pyarrow_3lib_195_get_default_context(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_default_context (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_194_get_default_context(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_194_get_default_context(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_register_default_serialization_handlers = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_get_default_context", 0);

  /* "pyarrow/serialization.pxi":228
 * def _get_default_context():
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers             # <<<<<<<<<<<<<<
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_register_default_serialization_h);
  __Pyx_GIVEREF(__pyx_n_s_register_default_serialization_h);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_register_default_serialization_h);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_serialization, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_register_default_serialization_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_register_default_serialization_handlers = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":229
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:             # <<<<<<<<<<<<<<
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_context_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(15, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":230
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)             # <<<<<<<<<<<<<<
 *         _default_context_initialized = True
 *     return _default_serialization_context
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_register_default_serialization_handlers);
    __pyx_t_5 = __pyx_v_register_default_serialization_handlers; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":231
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True             # <<<<<<<<<<<<<<
 *     return _default_serialization_context
 * 
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_context_initialized, Py_True) < 0) __PYX_ERR(15, 231, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":229
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:             # <<<<<<<<<<<<<<
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 */
  }

  /* "pyarrow/serialization.pxi":232
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 *     return _default_serialization_context             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_default_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_register_default_serialization_handlers);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":246
 * 
 *     @property
 *     def total_bytes(self):             # <<<<<<<<<<<<<<
 *         cdef CMockOutputStream mock_stream
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11total_bytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11total_bytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_11total_bytes___get__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_11total_bytes___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self) {
   arrow::io::MockOutputStream __pyx_v_mock_stream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/serialization.pxi":248
 *     def total_bytes(self):
 *         cdef CMockOutputStream mock_stream
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(&mock_stream))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":249
 *         cdef CMockOutputStream mock_stream
 *         with nogil:
 *             check_status(self.data.WriteTo(&mock_stream))             # <<<<<<<<<<<<<<
 * 
 *         return mock_stream.GetExtentBytesWritten()
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->data.WriteTo((&__pyx_v_mock_stream))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(15, 249, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":248
 *     def total_bytes(self):
 *         cdef CMockOutputStream mock_stream
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(&mock_stream))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":251
 *             check_status(self.data.WriteTo(&mock_stream))
 * 
 *         return mock_stream.GetExtentBytesWritten()             # <<<<<<<<<<<<<<
 * 
 *     def write_to(self, sink):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_mock_stream.GetExtentBytesWritten()); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":246
 * 
 *     @property
 *     def total_bytes(self):             # <<<<<<<<<<<<<<
 *         cdef CMockOutputStream mock_stream
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.total_bytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":253
 *         return mock_stream.GetExtentBytesWritten()
 * 
 *     def write_to(self, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized object to a sink
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_1write_to(PyObject *__pyx_v_self, PyObject *__pyx_v_sink); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_write_to[] = "SerializedPyObject.write_to(self, sink)\n\n        Write serialized object to a sink\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_1write_to(PyObject *__pyx_v_self, PyObject *__pyx_v_sink) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_write_to(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), ((PyObject *)__pyx_v_sink));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_sink) {
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_stream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("write_to", 0);

  /* "pyarrow/serialization.pxi":258
 *         """
 *         cdef shared_ptr[OutputStream] stream
 *         get_writer(sink, &stream)             # <<<<<<<<<<<<<<
 *         self._write_to(stream.get())
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":259
 *         cdef shared_ptr[OutputStream] stream
 *         get_writer(sink, &stream)
 *         self._write_to(stream.get())             # <<<<<<<<<<<<<<
 * 
 *     cdef _write_to(self, OutputStream* stream):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self->__pyx_vtab)->_write_to(__pyx_v_self, __pyx_v_stream.get()); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":253
 *         return mock_stream.GetExtentBytesWritten()
 * 
 *     def write_to(self, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized object to a sink
 */

  /* 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.lib.SerializedPyObject.write_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":261
 *         self._write_to(stream.get())
 * 
 *     cdef _write_to(self, OutputStream* stream):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.data.WriteTo(stream))
 */

static PyObject *__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, arrow::io::OutputStream *__pyx_v_stream) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_write_to", 0);

  /* "pyarrow/serialization.pxi":262
 * 
 *     cdef _write_to(self, OutputStream* stream):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(stream))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":263
 *     cdef _write_to(self, OutputStream* stream):
 *         with nogil:
 *             check_status(self.data.WriteTo(stream))             # <<<<<<<<<<<<<<
 * 
 *     def deserialize(self, SerializationContext context=None):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->data.WriteTo(__pyx_v_stream)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(15, 263, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":262
 * 
 *     cdef _write_to(self, OutputStream* stream):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(stream))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":261
 *         self._write_to(stream.get())
 * 
 *     cdef _write_to(self, OutputStream* stream):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.data.WriteTo(stream))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject._write_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":265
 *             check_status(self.data.WriteTo(stream))
 * 
 *     def deserialize(self, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert back to Python object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_3deserialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_2deserialize[] = "SerializedPyObject.deserialize(self, SerializationContext context=None)\n\n        Convert back to Python object\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_3deserialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize") < 0)) __PYX_ERR(15, 265, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 265, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(15, 265, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("deserialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":271
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _get_default_context()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":272
 * 
 *         if context is None:
 *             context = _get_default_context()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_default_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_SerializationContext))))) __PYX_ERR(15, 272, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_context, ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/serialization.pxi":271
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _get_default_context()
 * 
 */
  }

  /* "pyarrow/serialization.pxi":274
 *             context = _get_default_context()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DeserializeObject(context, self.data,
 *                                            <PyObject*> self.base, &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":275
 * 
 *         with nogil:
 *             check_status(DeserializeObject(context, self.data,             # <<<<<<<<<<<<<<
 *                                            <PyObject*> self.base, &result))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::DeserializeObject(((PyObject *)__pyx_v_context), __pyx_v_self->data, ((PyObject *)__pyx_v_self->base), (&__pyx_v_result))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(15, 275, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":274
 *             context = _get_default_context()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DeserializeObject(context, self.data,
 *                                            <PyObject*> self.base, &result))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/serialization.pxi":280
 *         # PyObject_to_object is necessary to avoid a memory leak;
 *         # also unpack the list the object was wrapped in in serialize
 *         return PyObject_to_object(result)[0]             # <<<<<<<<<<<<<<
 * 
 *     def to_buffer(self, nthreads=1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":265
 *             check_status(self.data.WriteTo(stream))
 * 
 *     def deserialize(self, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert back to Python object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":282
 *         return PyObject_to_object(result)[0]
 * 
 *     def to_buffer(self, nthreads=1):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized data as Buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_5to_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_4to_buffer[] = "SerializedPyObject.to_buffer(self, nthreads=1)\n\n        Write serialized data as Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_5to_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nthreads = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nthreads,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_buffer") < 0)) __PYX_ERR(15, 282, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nthreads = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_buffer", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 282, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.to_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_4to_buffer(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), __pyx_v_nthreads);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4to_buffer(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_nthreads) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_output = 0;
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_sink = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("to_buffer", 0);

  /* "pyarrow/serialization.pxi":286
 *         Write serialized data as Buffer
 *         """
 *         cdef Buffer output = allocate_buffer(self.total_bytes)             # <<<<<<<<<<<<<<
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_total_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __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(15, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(15, 286, __pyx_L1_error)
  __pyx_v_output = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":287
 *         """
 *         cdef Buffer output = allocate_buffer(self.total_bytes)
 *         sink = FixedSizeBufferWriter(output)             # <<<<<<<<<<<<<<
 *         if nthreads > 1:
 *             sink.set_memcopy_threads(nthreads)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter), ((PyObject *)__pyx_v_output)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sink = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":288
 *         cdef Buffer output = allocate_buffer(self.total_bytes)
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:             # <<<<<<<<<<<<<<
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_nthreads, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 288, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(15, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":289
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:
 *             sink.set_memcopy_threads(nthreads)             # <<<<<<<<<<<<<<
 *         self.write_to(sink)
 *         return output
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sink), __pyx_n_s_set_memcopy_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_nthreads) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_nthreads);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":288
 *         cdef Buffer output = allocate_buffer(self.total_bytes)
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:             # <<<<<<<<<<<<<<
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)
 */
  }

  /* "pyarrow/serialization.pxi":290
 *         if nthreads > 1:
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)             # <<<<<<<<<<<<<<
 *         return output
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_sink)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_sink));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":291
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":282
 *         return PyObject_to_object(result)[0]
 * 
 *     def to_buffer(self, nthreads=1):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized data as Buffer
 */

  /* 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.lib.SerializedPyObject.to_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XDECREF((PyObject *)__pyx_v_sink);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_6from_components[] = "SerializedPyObject.from_components(components)\n\n        Reconstruct SerializedPyObject from output of\n        SerializedPyObject.to_components\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_18SerializedPyObject_7from_components = {"from_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_6from_components};
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_components = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_components (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_components,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_components") < 0)) __PYX_ERR(15, 294, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_components = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_components", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 294, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.from_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(__pyx_v_components);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(PyObject *__pyx_v_components) {
  int __pyx_v_num_tensors;
  int __pyx_v_num_ndarrays;
  int __pyx_v_num_buffers;
  PyObject *__pyx_v_buffers = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("from_components", 0);

  /* "pyarrow/serialization.pxi":300
 *         """
 *         cdef:
 *             int num_tensors = components['num_tensors']             # <<<<<<<<<<<<<<
 *             int num_ndarrays = components['num_ndarrays']
 *             int num_buffers = components['num_buffers']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_tensors); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(15, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_tensors = __pyx_t_2;

  /* "pyarrow/serialization.pxi":301
 *         cdef:
 *             int num_tensors = components['num_tensors']
 *             int num_ndarrays = components['num_ndarrays']             # <<<<<<<<<<<<<<
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_ndarrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(15, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_ndarrays = __pyx_t_2;

  /* "pyarrow/serialization.pxi":302
 *             int num_tensors = components['num_tensors']
 *             int num_ndarrays = components['num_ndarrays']
 *             int num_buffers = components['num_buffers']             # <<<<<<<<<<<<<<
 *             list buffers = components['data']
 *             SerializedPyObject result = SerializedPyObject()
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_buffers); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(15, 302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_buffers = __pyx_t_2;

  /* "pyarrow/serialization.pxi":303
 *             int num_ndarrays = components['num_ndarrays']
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']             # <<<<<<<<<<<<<<
 *             SerializedPyObject result = SerializedPyObject()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(15, 303, __pyx_L1_error)
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":304
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']
 *             SerializedPyObject result = SerializedPyObject()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":306
 *             SerializedPyObject result = SerializedPyObject()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors, num_ndarrays,
 *                                                      num_buffers,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":307
 * 
 *         with nogil:
 *             check_status(GetSerializedFromComponents(num_tensors, num_ndarrays,             # <<<<<<<<<<<<<<
 *                                                      num_buffers,
 *                                                      buffers, &result.data))
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::GetSerializedFromComponents(__pyx_v_num_tensors, __pyx_v_num_ndarrays, __pyx_v_num_buffers, __pyx_v_buffers, (&__pyx_v_result->data))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(15, 307, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":306
 *             SerializedPyObject result = SerializedPyObject()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors, num_ndarrays,
 *                                                      num_buffers,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":311
 *                                                      buffers, &result.data))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_components(self, memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.from_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffers);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":313
 *         return result
 * 
 *     def to_components(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return the decomposed dict representation of the serialized object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_9to_components(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_8to_components[] = "SerializedPyObject.to_components(self, memory_pool=None)\n\n        Return the decomposed dict representation of the serialized object\n        containing a collection of Buffer objects which maximize opportunities\n        for zero-copy\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool default None\n            Pool to use for necessary allocations\n\n        Returns\n\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_9to_components(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_components (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_components") < 0)) __PYX_ERR(15, 313, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_components", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 313, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.to_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_8to_components(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_8to_components(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_memory_pool) {
  PyObject *__pyx_v_result;
   arrow::MemoryPool *__pyx_v_c_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("to_components", 0);

  /* "pyarrow/serialization.pxi":328
 *         """
 *         cdef PyObject* result
 *         cdef CMemoryPool* c_pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(((__pyx_v_memory_pool) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_memory_pool, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(15, 328, __pyx_L1_error)
  __pyx_v_c_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_memory_pool));

  /* "pyarrow/serialization.pxi":330
 *         cdef CMemoryPool* c_pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.GetComponents(c_pool, &result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":331
 * 
 *         with nogil:
 *             check_status(self.data.GetComponents(c_pool, &result))             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(result)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->data.GetComponents(__pyx_v_c_pool, (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(15, 331, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":330
 *         cdef CMemoryPool* c_pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.GetComponents(c_pool, &result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":333
 *             check_status(self.data.GetComponents(c_pool, &result))
 * 
 *         return PyObject_to_object(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":313
 *         return result
 * 
 *     def to_components(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return the decomposed dict representation of the serialized object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.to_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":243
 * 
 *     cdef readonly:
 *         object base             # <<<<<<<<<<<<<<
 * 
 *     @property
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_4base_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_4base___get__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4base___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->base);
  __pyx_r = __pyx_v_self->base;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__[] = "SerializedPyObject.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__254, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.__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.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__[] = "SerializedPyObject.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__255, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":336
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_197serialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_196serialize[] = "serialize(value, SerializationContext context=None)\nEXPERIMENTAL: Serialize a general Python sequence for transient storage\n    and transport. This may have better performance and memory efficiency than\n    Python pickle.\n\n    Note: this function produces data that is incompatible with the standard\n    Arrow IPC binary protocol, i.e. it cannot be used with ipc.open_stream or\n    ipc.open_file. You can use deserialize, deserialize_from, or\n    deserialize_components to read it.\n\n    Parameters\n    ----------\n    value: object\n        Python object for the sequence that is to be serialized.\n    context : SerializationContext\n        Custom serialization and deserialization context, uses a default\n        context with some standard type handlers if not specified\n\n    Returns\n    -------\n    serialized : SerializedPyObject\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_197serialize = {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_197serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_196serialize};
static PyObject *__pyx_pw_7pyarrow_3lib_197serialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_context,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(15, 336, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value = values[0];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 336, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(15, 336, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_196serialize(__pyx_self, __pyx_v_value, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_196serialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_v_wrapped_value = NULL;
  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_t_6;
  __Pyx_RefNannySetupContext("serialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":359
 * 
 *     """
 *     cdef SerializedPyObject serialized = SerializedPyObject()             # <<<<<<<<<<<<<<
 *     wrapped_value = [value]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_serialized = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":360
 *     """
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     wrapped_value = [value]             # <<<<<<<<<<<<<<
 * 
 *     if context is None:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __pyx_v_wrapped_value = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":362
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _get_default_context()
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":363
 * 
 *     if context is None:
 *         context = _get_default_context()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_default_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_SerializationContext))))) __PYX_ERR(15, 363, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_context, ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":362
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _get_default_context()
 * 
 */
  }

  /* "pyarrow/serialization.pxi":365
 *         context = _get_default_context()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":366
 * 
 *     with nogil:
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))             # <<<<<<<<<<<<<<
 *     return serialized
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SerializeObject(((PyObject *)__pyx_v_context), __pyx_v_wrapped_value, (&__pyx_v_serialized->data))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(15, 366, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":365
 *         context = _get_default_context()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/serialization.pxi":367
 *     with nogil:
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_serialized));
  __pyx_r = ((PyObject *)__pyx_v_serialized);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":336
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_serialized);
  __Pyx_XDECREF(__pyx_v_wrapped_value);
  __Pyx_XDECREF((PyObject *)__pyx_v_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":370
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_199serialize_to(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_198serialize_to[] = "serialize_to(value, sink, SerializationContext context=None)\nEXPERIMENTAL: Serialize a Python sequence to a file.\n\n    Parameters\n    ----------\n    value: object\n        Python object for the sequence that is to be serialized.\n    sink: NativeFile or file-like\n        File the sequence will be written to.\n    context : SerializationContext\n        Custom serialization and deserialization context, uses a default\n        context with some standard type handlers if not specified\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_199serialize_to = {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_199serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_198serialize_to};
static PyObject *__pyx_pw_7pyarrow_3lib_199serialize_to(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_sink = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize_to (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_sink,&__pyx_n_s_context,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("serialize_to", 0, 2, 3, 1); __PYX_ERR(15, 370, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize_to") < 0)) __PYX_ERR(15, 370, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value = values[0];
    __pyx_v_sink = values[1];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize_to", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 370, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(15, 370, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_198serialize_to(__pyx_self, __pyx_v_value, __pyx_v_sink, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_198serialize_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_serialized = NULL;
  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 = NULL;
  __Pyx_RefNannySetupContext("serialize_to", 0);

  /* "pyarrow/serialization.pxi":383
 *         context with some standard type handlers if not specified
 *     """
 *     serialized = serialize(value, context)             # <<<<<<<<<<<<<<
 *     serialized.write_to(sink)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_value, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 383, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_value, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 383, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_value);
    __Pyx_INCREF(((PyObject *)__pyx_v_context));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_context));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_serialized = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":384
 *     """
 *     serialized = serialize(value, context)
 *     serialized.write_to(sink)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized, __pyx_n_s_write_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_sink) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_sink);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":370
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */

  /* 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_5);
  __Pyx_AddTraceback("pyarrow.lib.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":387
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_201read_serialized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_200read_serialized[] = "read_serialized(source, base=None)\nEXPERIMENTAL: Read serialized Python sequence from file-like object\n\n    Parameters\n    ----------\n    source: NativeFile\n        File to read the sequence from.\n    base: object\n        This object will be the base object of all the numpy arrays\n        contained in the sequence.\n\n    Returns\n    -------\n    serialized : the serialized data\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_201read_serialized = {"read_serialized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_201read_serialized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_200read_serialized};
static PyObject *__pyx_pw_7pyarrow_3lib_201read_serialized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_serialized (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_base,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_serialized") < 0)) __PYX_ERR(15, 387, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_base = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_serialized", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 387, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.read_serialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_200read_serialized(__pyx_self, __pyx_v_source, __pyx_v_base);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_200read_serialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base) {
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_stream;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("read_serialized", 0);

  /* "pyarrow/serialization.pxi":403
 *     """
 *     cdef shared_ptr[RandomAccessFile] stream
 *     get_reader(source, True, &stream)             # <<<<<<<<<<<<<<
 * 
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_source, 1, (&__pyx_v_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":405
 *     get_reader(source, True, &stream)
 * 
 *     cdef SerializedPyObject serialized = SerializedPyObject()             # <<<<<<<<<<<<<<
 *     serialized.base = base
 *     with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_serialized = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":406
 * 
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     serialized.base = base             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 */
  __Pyx_INCREF(__pyx_v_base);
  __Pyx_GIVEREF(__pyx_v_base);
  __Pyx_GOTREF(__pyx_v_serialized->base);
  __Pyx_DECREF(__pyx_v_serialized->base);
  __pyx_v_serialized->base = __pyx_v_base;

  /* "pyarrow/serialization.pxi":407
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     serialized.base = base
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":408
 *     serialized.base = base
 *     with nogil:
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))             # <<<<<<<<<<<<<<
 * 
 *     return serialized
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ReadSerializedObject(__pyx_v_stream.get(), (&__pyx_v_serialized->data))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(15, 408, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":407
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     serialized.base = base
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":410
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 * 
 *     return serialized             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_serialized));
  __pyx_r = ((PyObject *)__pyx_v_serialized);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":387
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.read_serialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":413
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_203deserialize_from(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_202deserialize_from[] = "deserialize_from(source, base, SerializationContext context=None)\nEXPERIMENTAL: Deserialize a Python sequence from a file. This only can\n    interact with data produced by pyarrow.serialize or pyarrow.serialize_to\n\n    Parameters\n    ----------\n    source: NativeFile\n        File to read the sequence from.\n    base: object\n        This object will be the base object of all the numpy arrays\n        contained in the sequence.\n    context : SerializationContext\n        Custom serialization and deserialization context\n\n    Returns\n    -------\n    object\n        Python object for the deserialized sequence.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_203deserialize_from = {"deserialize_from", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_203deserialize_from, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_202deserialize_from};
static PyObject *__pyx_pw_7pyarrow_3lib_203deserialize_from(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_base = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize_from (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_base,&__pyx_n_s_context,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("deserialize_from", 0, 2, 3, 1); __PYX_ERR(15, 413, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize_from") < 0)) __PYX_ERR(15, 413, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_base = values[1];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize_from", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 413, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.deserialize_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(15, 413, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_202deserialize_from(__pyx_self, __pyx_v_source, __pyx_v_base, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_202deserialize_from(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_serialized = 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;
  __Pyx_RefNannySetupContext("deserialize_from", 0);

  /* "pyarrow/serialization.pxi":432
 *         Python object for the deserialized sequence.
 *     """
 *     serialized = read_serialized(source, base=base)             # <<<<<<<<<<<<<<
 *     return serialized.deserialize(context)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_serialized); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_source);
  __Pyx_GIVEREF(__pyx_v_source);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base, __pyx_v_base) < 0) __PYX_ERR(15, 432, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_serialized = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/serialization.pxi":433
 *     """
 *     serialized = read_serialized(source, base=base)
 *     return serialized.deserialize(context)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized, __pyx_n_s_deserialize); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_context)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_context));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":413
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */

  /* 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.lib.deserialize_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":436
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_205deserialize_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_204deserialize_components[] = "deserialize_components(components, SerializationContext context=None)\n\n    Reconstruct Python object from output of SerializedPyObject.to_components\n\n    Parameters\n    ----------\n    components : dict\n        Output of SerializedPyObject.to_components\n    context : SerializationContext, default None\n\n    Returns\n    -------\n    object : the Python object that was originally serialized\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_205deserialize_components = {"deserialize_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_205deserialize_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_204deserialize_components};
static PyObject *__pyx_pw_7pyarrow_3lib_205deserialize_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_components = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize_components (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_components,&__pyx_n_s_context,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize_components") < 0)) __PYX_ERR(15, 436, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_components = values[0];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize_components", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 436, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.deserialize_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(15, 436, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_204deserialize_components(__pyx_self, __pyx_v_components, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_204deserialize_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_components, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_serialized = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("deserialize_components", 0);

  /* "pyarrow/serialization.pxi":450
 *     object : the Python object that was originally serialized
 *     """
 *     serialized = SerializedPyObject.from_components(components)             # <<<<<<<<<<<<<<
 *     return serialized.deserialize(context)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject), __pyx_n_s_from_components); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_components) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_components);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_serialized = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":451
 *     """
 *     serialized = SerializedPyObject.from_components(components)
 *     return serialized.deserialize(context)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized, __pyx_n_s_deserialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_context)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_context));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 451, __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/serialization.pxi":436
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.deserialize_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":454
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_207deserialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_206deserialize[] = "deserialize(obj, SerializationContext context=None)\nEXPERIMENTAL: Deserialize Python object from Buffer or other Python\n    object supporting the buffer protocol. This only can interact with data\n    produced by pyarrow.serialize or pyarrow.serialize_to\n\n    Parameters\n    ----------\n    obj : pyarrow.Buffer or Python object supporting buffer protocol\n    context : SerializationContext\n        Custom serialization and deserialization context\n\n    Returns\n    -------\n    deserialized : object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_207deserialize = {"deserialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_207deserialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_206deserialize};
static PyObject *__pyx_pw_7pyarrow_3lib_207deserialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_context,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize") < 0)) __PYX_ERR(15, 454, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 454, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(15, 454, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_206deserialize(__pyx_self, __pyx_v_obj, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_206deserialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_source = NULL;
  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 = NULL;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/serialization.pxi":469
 *     deserialized : object
 *     """
 *     source = BufferReader(obj)             # <<<<<<<<<<<<<<
 *     return deserialize_from(source, obj, context)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_source = ((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":470
 *     """
 *     source = BufferReader(obj)
 *     return deserialize_from(source, obj, context)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_deserialize_from); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_source), __pyx_v_obj, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 470, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_source), __pyx_v_obj, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 470, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_source));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_source));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_source));
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_obj);
    __Pyx_INCREF(((PyObject *)__pyx_v_context));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, ((PyObject *)__pyx_v_context));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":454
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_209benchmark_PandasObjectIsNull(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_208benchmark_PandasObjectIsNull[] = "benchmark_PandasObjectIsNull(list obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_209benchmark_PandasObjectIsNull = {"benchmark_PandasObjectIsNull", (PyCFunction)__pyx_pw_7pyarrow_3lib_209benchmark_PandasObjectIsNull, METH_O, __pyx_doc_7pyarrow_3lib_208benchmark_PandasObjectIsNull};
static PyObject *__pyx_pw_7pyarrow_3lib_209benchmark_PandasObjectIsNull(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("benchmark_PandasObjectIsNull (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) __PYX_ERR(16, 19, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_208benchmark_PandasObjectIsNull(__pyx_self, ((PyObject*)__pyx_v_obj));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_208benchmark_PandasObjectIsNull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("benchmark_PandasObjectIsNull", 0);

  /* "pyarrow/benchmark.pxi":20
 * 
 * def benchmark_PandasObjectIsNull(list obj):
 *     Benchmark_PandasObjectIsNull(obj)             # <<<<<<<<<<<<<<
 */
  arrow::py::benchmark::Benchmark_PandasObjectIsNull(__pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(16, 20, __pyx_L1_error)

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.benchmark_PandasObjectIsNull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":28
 * 
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     return isinstance(buffer, Buffer)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_buffer(PyObject *__pyx_v_buffer) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_buffer", 0);

  /* "pyarrow/public-api.pxi":29
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):
 *     return isinstance(buffer, Buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_buffer, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":28
 * 
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     return isinstance(buffer, Buffer)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":32
 * 
 * 
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):
 */

std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(PyObject *__pyx_v_buffer) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  std::shared_ptr< arrow::Buffer>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_buffer", 0);

  /* "pyarrow/public-api.pxi":34
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):             # <<<<<<<<<<<<<<
 *         buf = <Buffer>(buffer)
 *         return buf.buffer
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_buffer(__pyx_v_buffer) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":35
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):
 *         buf = <Buffer>(buffer)             # <<<<<<<<<<<<<<
 *         return buf.buffer
 * 
 */
    __pyx_t_2 = __pyx_v_buffer;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":36
 *     if pyarrow_is_buffer(buffer):
 *         buf = <Buffer>(buffer)
 *         return buf.buffer             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CBuffer]()
 */
    __pyx_r = __pyx_v_buf->buffer;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":34
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):             # <<<<<<<<<<<<<<
 *         buf = <Buffer>(buffer)
 *         return buf.buffer
 */
  }

  /* "pyarrow/public-api.pxi":38
 *         return buf.buffer
 * 
 *     return shared_ptr[CBuffer]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Buffer> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":32
 * 
 * 
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":41
 * 
 * 
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):             # <<<<<<<<<<<<<<
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(std::shared_ptr< arrow::Buffer>  const &__pyx_v_buf) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_buffer", 0);

  /* "pyarrow/public-api.pxi":42
 * 
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):
 *     cdef Buffer result = Buffer.__new__(Buffer)             # <<<<<<<<<<<<<<
 *     result.init(buf)
 *     return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Buffer(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Buffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 42, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":43
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *)__pyx_v_result->__pyx_vtab)->init(__pyx_v_result, __pyx_v_buf);

  /* "pyarrow/public-api.pxi":44
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":41
 * 
 * 
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):             # <<<<<<<<<<<<<<
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":47
 * 
 * 
 * cdef api object pyarrow_wrap_resizable_buffer(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer(std::shared_ptr< arrow::ResizableBuffer>  const &__pyx_v_buf) {
  struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_resizable_buffer", 0);

  /* "pyarrow/public-api.pxi":49
 * cdef api object pyarrow_wrap_resizable_buffer(
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)             # <<<<<<<<<<<<<<
 *     result.init_rz(buf)
 *     return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ResizableBuffer(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ResizableBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 49, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":50
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 *     result.init_rz(buf)             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer *)__pyx_v_result->__pyx_base.__pyx_vtab)->init_rz(__pyx_v_result, __pyx_v_buf);

  /* "pyarrow/public-api.pxi":51
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 *     result.init_rz(buf)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":47
 * 
 * 
 * cdef api object pyarrow_wrap_resizable_buffer(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_resizable_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":54
 * 
 * 
 * cdef api bint pyarrow_is_data_type(object type_):             # <<<<<<<<<<<<<<
 *     return isinstance(type_, DataType)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_data_type(PyObject *__pyx_v_type_) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_data_type", 0);

  /* "pyarrow/public-api.pxi":55
 * 
 * cdef api bint pyarrow_is_data_type(object type_):
 *     return isinstance(type_, DataType)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_type_, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":54
 * 
 * 
 * cdef api bint pyarrow_is_data_type(object type_):             # <<<<<<<<<<<<<<
 *     return isinstance(type_, DataType)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":58
 * 
 * 
 * cdef api shared_ptr[CDataType] pyarrow_unwrap_data_type(             # <<<<<<<<<<<<<<
 *         object data_type):
 *     cdef DataType type_
 */

std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type(PyObject *__pyx_v_data_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type_ = 0;
  std::shared_ptr< arrow::DataType>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_data_type", 0);

  /* "pyarrow/public-api.pxi":61
 *         object data_type):
 *     cdef DataType type_
 *     if pyarrow_is_data_type(data_type):             # <<<<<<<<<<<<<<
 *         type_ = <DataType>(data_type)
 *         return type_.sp_type
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_data_type(__pyx_v_data_type) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":62
 *     cdef DataType type_
 *     if pyarrow_is_data_type(data_type):
 *         type_ = <DataType>(data_type)             # <<<<<<<<<<<<<<
 *         return type_.sp_type
 * 
 */
    __pyx_t_2 = __pyx_v_data_type;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_type_ = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":63
 *     if pyarrow_is_data_type(data_type):
 *         type_ = <DataType>(data_type)
 *         return type_.sp_type             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CDataType]()
 */
    __pyx_r = __pyx_v_type_->sp_type;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":61
 *         object data_type):
 *     cdef DataType type_
 *     if pyarrow_is_data_type(data_type):             # <<<<<<<<<<<<<<
 *         type_ = <DataType>(data_type)
 *         return type_.sp_type
 */
  }

  /* "pyarrow/public-api.pxi":65
 *         return type_.sp_type
 * 
 *     return shared_ptr[CDataType]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::DataType> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":58
 * 
 * 
 * cdef api shared_ptr[CDataType] pyarrow_unwrap_data_type(             # <<<<<<<<<<<<<<
 *         object data_type):
 *     cdef DataType type_
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type_);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":73
 * 
 * 
 * cdef api object pyarrow_wrap_data_type(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CDataType]& type):
 *     cdef:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
   arrow::ExtensionType const *__pyx_v_ext_type;
   arrow::py::PyExtensionType const *__pyx_v_cpy_ext_type;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __pyx_t_7pyarrow_3lib__CPyExtensionTypePtr __pyx_t_3;
  __Pyx_RefNannySetupContext("pyarrow_wrap_data_type", 0);

  /* "pyarrow/public-api.pxi":80
 *         DataType out
 * 
 *     if type.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((__pyx_v_type.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":81
 * 
 *     if type.get() == NULL:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     if type.get().id() == _Type_DICTIONARY:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":80
 *         DataType out
 * 
 *     if type.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "pyarrow/public-api.pxi":83
 *         return None
 * 
 *     if type.get().id() == _Type_DICTIONARY:             # <<<<<<<<<<<<<<
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::DICTIONARY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":84
 * 
 *     if type.get().id() == _Type_DICTIONARY:
 *         out = DictionaryType.__new__(DictionaryType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DictionaryType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DictionaryType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 84, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 84, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":83
 *         return None
 * 
 *     if type.get().id() == _Type_DICTIONARY:             # <<<<<<<<<<<<<<
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":85
 *     if type.get().id() == _Type_DICTIONARY:
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:             # <<<<<<<<<<<<<<
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::LIST) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":86
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 86, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 86, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":85
 *     if type.get().id() == _Type_DICTIONARY:
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:             # <<<<<<<<<<<<<<
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":87
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:             # <<<<<<<<<<<<<<
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_STRUCT:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::LARGE_LIST) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":88
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LargeListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LargeListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 88, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 88, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":87
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:             # <<<<<<<<<<<<<<
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_STRUCT:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":89
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_STRUCT:             # <<<<<<<<<<<<<<
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::STRUCT) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":90
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_StructType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_StructType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 90, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 90, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":89
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_STRUCT:             # <<<<<<<<<<<<<<
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":91
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:             # <<<<<<<<<<<<<<
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::UNION) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":92
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_UnionType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_UnionType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 92, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 92, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":91
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:             # <<<<<<<<<<<<<<
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":93
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:             # <<<<<<<<<<<<<<
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::TIMESTAMP) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":94
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_TimestampType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_TimestampType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 94, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 94, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":93
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:             # <<<<<<<<<<<<<<
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":95
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:             # <<<<<<<<<<<<<<
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::FIXED_SIZE_BINARY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":96
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 96, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 96, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":95
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:             # <<<<<<<<<<<<<<
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":97
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:             # <<<<<<<<<<<<<<
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::DECIMAL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":98
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_EXTENSION:
 *         ext_type = <const CExtensionType*> type.get()
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Decimal128Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Decimal128Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 98, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 98, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":97
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:             # <<<<<<<<<<<<<<
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":99
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:             # <<<<<<<<<<<<<<
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::EXTENSION) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":100
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:
 *         ext_type = <const CExtensionType*> type.get()             # <<<<<<<<<<<<<<
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:
 */
    __pyx_v_ext_type = (( arrow::ExtensionType const *)__pyx_v_type.get());

    /* "pyarrow/public-api.pxi":101
 *     elif type.get().id() == _Type_EXTENSION:
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)             # <<<<<<<<<<<<<<
 *         if cpy_ext_type != nullptr:
 *             return cpy_ext_type.GetInstance()
 */
    try {
      __pyx_t_3 = dynamic_cast<__pyx_t_7pyarrow_3lib__CPyExtensionTypePtr>(__pyx_v_ext_type);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(17, 101, __pyx_L1_error)
    }
    __pyx_v_cpy_ext_type = __pyx_t_3;

    /* "pyarrow/public-api.pxi":102
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:             # <<<<<<<<<<<<<<
 *             return cpy_ext_type.GetInstance()
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_cpy_ext_type != nullptr) != 0);
    if (__pyx_t_1) {

      /* "pyarrow/public-api.pxi":103
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:
 *             return cpy_ext_type.GetInstance()             # <<<<<<<<<<<<<<
 *         else:
 *             out = BaseExtensionType.__new__(BaseExtensionType)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __pyx_v_cpy_ext_type->GetInstance(); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "pyarrow/public-api.pxi":102
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:             # <<<<<<<<<<<<<<
 *             return cpy_ext_type.GetInstance()
 *         else:
 */
    }

    /* "pyarrow/public-api.pxi":105
 *             return cpy_ext_type.GetInstance()
 *         else:
 *             out = BaseExtensionType.__new__(BaseExtensionType)             # <<<<<<<<<<<<<<
 *     else:
 *         out = DataType.__new__(DataType)
 */
    /*else*/ {
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_BaseExtensionType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_BaseExtensionType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 105, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(17, 105, __pyx_L1_error)
      __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
      __pyx_t_2 = 0;
    }

    /* "pyarrow/public-api.pxi":99
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:             # <<<<<<<<<<<<<<
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":107
 *             out = BaseExtensionType.__new__(BaseExtensionType)
 *     else:
 *         out = DataType.__new__(DataType)             # <<<<<<<<<<<<<<
 * 
 *     out.init(type)
 */
  /*else*/ {
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DataType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DataType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 107, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/public-api.pxi":109
 *         out = DataType.__new__(DataType)
 * 
 *     out.init(type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_DataType *)__pyx_v_out->__pyx_vtab)->init(__pyx_v_out, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 109, __pyx_L1_error)

  /* "pyarrow/public-api.pxi":110
 * 
 *     out.init(type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":73
 * 
 * 
 * cdef api object pyarrow_wrap_data_type(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CDataType]& type):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":113
 * 
 * 
 * cdef object pyarrow_wrap_metadata(             # <<<<<<<<<<<<<<
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 */

static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(std::shared_ptr< arrow::KeyValueMetadata const >  const &__pyx_v_meta) {
   arrow::KeyValueMetadata const *__pyx_v_cmeta;
  PyObject *__pyx_v_result = NULL;
  int64_t __pyx_v_i;
  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;
  int64_t __pyx_t_5;
  int64_t __pyx_t_6;
  int64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("pyarrow_wrap_metadata", 0);

  /* "pyarrow/public-api.pxi":115
 * cdef object pyarrow_wrap_metadata(
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()             # <<<<<<<<<<<<<<
 * 
 *     if cmeta == nullptr:
 */
  __pyx_v_cmeta = __pyx_v_meta.get();

  /* "pyarrow/public-api.pxi":117
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 * 
 *     if cmeta == nullptr:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((__pyx_v_cmeta == nullptr) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":118
 * 
 *     if cmeta == nullptr:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     result = ordered_dict()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":117
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 * 
 *     if cmeta == nullptr:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "pyarrow/public-api.pxi":120
 *         return None
 * 
 *     result = ordered_dict()             # <<<<<<<<<<<<<<
 *     for i in range(cmeta.size()):
 *         result[cmeta.key(i)] = cmeta.value(i)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":121
 * 
 *     result = ordered_dict()
 *     for i in range(cmeta.size()):             # <<<<<<<<<<<<<<
 *         result[cmeta.key(i)] = cmeta.value(i)
 * 
 */
  __pyx_t_5 = __pyx_v_cmeta->size();
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyarrow/public-api.pxi":122
 *     result = ordered_dict()
 *     for i in range(cmeta.size()):
 *         result[cmeta.key(i)] = cmeta.value(i)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cmeta->value(__pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cmeta->key(__pyx_v_i)); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyObject_SetItem(__pyx_v_result, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(17, 122, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyarrow/public-api.pxi":124
 *         result[cmeta.key(i)] = cmeta.value(i)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":113
 * 
 * 
 * cdef object pyarrow_wrap_metadata(             # <<<<<<<<<<<<<<
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":127
 * 
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta):             # <<<<<<<<<<<<<<
 *     cdef vector[c_string] keys, values
 * 
 */

static std::shared_ptr< arrow::KeyValueMetadata>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(PyObject *__pyx_v_meta) {
  std::vector<std::string>  __pyx_v_keys;
  std::vector<std::string>  __pyx_v_values;
  std::shared_ptr< arrow::KeyValueMetadata>  __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 = NULL;
  std::vector<std::string>  __pyx_t_7;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_t_8;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_metadata", 0);

  /* "pyarrow/public-api.pxi":130
 *     cdef vector[c_string] keys, values
 * 
 *     if isinstance(meta, dict):             # <<<<<<<<<<<<<<
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_meta); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/public-api.pxi":131
 * 
 *     if isinstance(meta, dict):
 *         keys = map(tobytes, meta.keys())             # <<<<<<<<<<<<<<
 *         values = map(tobytes, meta.values())
 *         return make_shared[CKeyValueMetadata](keys, values)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_keys = __pyx_t_7;

    /* "pyarrow/public-api.pxi":132
 *     if isinstance(meta, dict):
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())             # <<<<<<<<<<<<<<
 *         return make_shared[CKeyValueMetadata](keys, values)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 132, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_values = __pyx_t_7;

    /* "pyarrow/public-api.pxi":133
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 *         return make_shared[CKeyValueMetadata](keys, values)             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CKeyValueMetadata]()
 */
    try {
      __pyx_t_8 = std::make_shared< arrow::KeyValueMetadata>(__pyx_v_keys, __pyx_v_values);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(17, 133, __pyx_L1_error)
    }
    __pyx_r = __pyx_t_8;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":130
 *     cdef vector[c_string] keys, values
 * 
 *     if isinstance(meta, dict):             # <<<<<<<<<<<<<<
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 */
  }

  /* "pyarrow/public-api.pxi":135
 *         return make_shared[CKeyValueMetadata](keys, values)
 * 
 *     return shared_ptr[CKeyValueMetadata]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::KeyValueMetadata> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":127
 * 
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta):             # <<<<<<<<<<<<<<
 *     cdef vector[c_string] keys, values
 * 
 */

  /* 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_WriteUnraisable("pyarrow.lib.pyarrow_unwrap_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":138
 * 
 * 
 * cdef api bint pyarrow_is_field(object field):             # <<<<<<<<<<<<<<
 *     return isinstance(field, Field)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_field(PyObject *__pyx_v_field) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_field", 0);

  /* "pyarrow/public-api.pxi":139
 * 
 * cdef api bint pyarrow_is_field(object field):
 *     return isinstance(field, Field)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_field, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":138
 * 
 * 
 * cdef api bint pyarrow_is_field(object field):             # <<<<<<<<<<<<<<
 *     return isinstance(field, Field)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":142
 * 
 * 
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):             # <<<<<<<<<<<<<<
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 */

std::shared_ptr< arrow::Field>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_field(PyObject *__pyx_v_field) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field_ = 0;
  std::shared_ptr< arrow::Field>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_field", 0);

  /* "pyarrow/public-api.pxi":144
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):
 *     cdef Field field_
 *     if pyarrow_is_field(field):             # <<<<<<<<<<<<<<
 *         field_ = <Field>(field)
 *         return field_.sp_field
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_field(__pyx_v_field) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":145
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 *         field_ = <Field>(field)             # <<<<<<<<<<<<<<
 *         return field_.sp_field
 * 
 */
    __pyx_t_2 = __pyx_v_field;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_field_ = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":146
 *     if pyarrow_is_field(field):
 *         field_ = <Field>(field)
 *         return field_.sp_field             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CField]()
 */
    __pyx_r = __pyx_v_field_->sp_field;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":144
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):
 *     cdef Field field_
 *     if pyarrow_is_field(field):             # <<<<<<<<<<<<<<
 *         field_ = <Field>(field)
 *         return field_.sp_field
 */
  }

  /* "pyarrow/public-api.pxi":148
 *         return field_.sp_field
 * 
 *     return shared_ptr[CField]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Field> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":142
 * 
 * 
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):             # <<<<<<<<<<<<<<
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_field_);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":151
 * 
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *     if field.get() == NULL:
 *         return None
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_field(std::shared_ptr< arrow::Field>  const &__pyx_v_field) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_field", 0);

  /* "pyarrow/public-api.pxi":152
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef Field out = Field.__new__(Field)
 */
  __pyx_t_1 = ((__pyx_v_field.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":153
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     cdef Field out = Field.__new__(Field)
 *     out.init(field)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":152
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef Field out = Field.__new__(Field)
 */
  }

  /* "pyarrow/public-api.pxi":154
 *     if field.get() == NULL:
 *         return None
 *     cdef Field out = Field.__new__(Field)             # <<<<<<<<<<<<<<
 *     out.init(field)
 *     return out
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Field(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Field), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 154, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":155
 *         return None
 *     cdef Field out = Field.__new__(Field)
 *     out.init(field)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Field *)__pyx_v_out->__pyx_vtab)->init(__pyx_v_out, __pyx_v_field);

  /* "pyarrow/public-api.pxi":156
 *     cdef Field out = Field.__new__(Field)
 *     out.init(field)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":151
 * 
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *     if field.get() == NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":159
 * 
 * 
 * cdef api bint pyarrow_is_schema(object schema):             # <<<<<<<<<<<<<<
 *     return isinstance(schema, Schema)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_schema(PyObject *__pyx_v_schema) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_schema", 0);

  /* "pyarrow/public-api.pxi":160
 * 
 * cdef api bint pyarrow_is_schema(object schema):
 *     return isinstance(schema, Schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_schema, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":159
 * 
 * 
 * cdef api bint pyarrow_is_schema(object schema):             # <<<<<<<<<<<<<<
 *     return isinstance(schema, Schema)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":163
 * 
 * 
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):             # <<<<<<<<<<<<<<
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 */

std::shared_ptr< arrow::Schema>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(PyObject *__pyx_v_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_sch = 0;
  std::shared_ptr< arrow::Schema>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_schema", 0);

  /* "pyarrow/public-api.pxi":165
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):             # <<<<<<<<<<<<<<
 *         sch = <Schema>(schema)
 *         return sch.sp_schema
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_schema(__pyx_v_schema) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":166
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 *         sch = <Schema>(schema)             # <<<<<<<<<<<<<<
 *         return sch.sp_schema
 * 
 */
    __pyx_t_2 = __pyx_v_schema;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_sch = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":167
 *     if pyarrow_is_schema(schema):
 *         sch = <Schema>(schema)
 *         return sch.sp_schema             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CSchema]()
 */
    __pyx_r = __pyx_v_sch->sp_schema;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":165
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):             # <<<<<<<<<<<<<<
 *         sch = <Schema>(schema)
 *         return sch.sp_schema
 */
  }

  /* "pyarrow/public-api.pxi":169
 *         return sch.sp_schema
 * 
 *     return shared_ptr[CSchema]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Schema> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":163
 * 
 * 
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):             # <<<<<<<<<<<<<<
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sch);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":172
 * 
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(std::shared_ptr< arrow::Schema>  const &__pyx_v_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_schema", 0);

  /* "pyarrow/public-api.pxi":173
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):
 *     cdef Schema out = Schema.__new__(Schema)             # <<<<<<<<<<<<<<
 *     out.init_schema(schema)
 *     return out
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Schema(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Schema), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 173, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":174
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Schema *)__pyx_v_out->__pyx_vtab)->init_schema(__pyx_v_out, __pyx_v_schema);

  /* "pyarrow/public-api.pxi":175
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":172
 * 
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":178
 * 
 * 
 * cdef api bint pyarrow_is_array(object array):             # <<<<<<<<<<<<<<
 *     return isinstance(array, Array)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_array(PyObject *__pyx_v_array) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_array", 0);

  /* "pyarrow/public-api.pxi":179
 * 
 * cdef api bint pyarrow_is_array(object array):
 *     return isinstance(array, Array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_array, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":178
 * 
 * 
 * cdef api bint pyarrow_is_array(object array):             # <<<<<<<<<<<<<<
 *     return isinstance(array, Array)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":182
 * 
 * 
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):             # <<<<<<<<<<<<<<
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 */

std::shared_ptr< arrow::Array>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(PyObject *__pyx_v_array) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::shared_ptr< arrow::Array>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_array", 0);

  /* "pyarrow/public-api.pxi":184
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):
 *     cdef Array arr
 *     if pyarrow_is_array(array):             # <<<<<<<<<<<<<<
 *         arr = <Array>(array)
 *         return arr.sp_array
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_array(__pyx_v_array) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":185
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 *         arr = <Array>(array)             # <<<<<<<<<<<<<<
 *         return arr.sp_array
 * 
 */
    __pyx_t_2 = __pyx_v_array;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":186
 *     if pyarrow_is_array(array):
 *         arr = <Array>(array)
 *         return arr.sp_array             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CArray]()
 */
    __pyx_r = __pyx_v_arr->sp_array;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":184
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):
 *     cdef Array arr
 *     if pyarrow_is_array(array):             # <<<<<<<<<<<<<<
 *         arr = <Array>(array)
 *         return arr.sp_array
 */
  }

  /* "pyarrow/public-api.pxi":188
 *         return arr.sp_array
 * 
 *     return shared_ptr[CArray]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Array> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":182
 * 
 * 
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):             # <<<<<<<<<<<<<<
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":191
 * 
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_array(std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
   arrow::DataType *__pyx_v_data_type;
  PyObject *__pyx_v_klass = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_array", 0);

  /* "pyarrow/public-api.pxi":192
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_array.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":193
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__256, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 193, __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(17, 193, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":192
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":195
 *         raise ValueError('Array was NULL')
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()             # <<<<<<<<<<<<<<
 * 
 *     if data_type == NULL:
 */
  __pyx_v_data_type = __pyx_v_sp_array.get()->type().get();

  /* "pyarrow/public-api.pxi":197
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array data type was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_type == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":198
 * 
 *     if data_type == NULL:
 *         raise ValueError('Array data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _array_classes[data_type.id()]
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__257, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 198, __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(17, 198, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":197
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":200
 *         raise ValueError('Array data type was NULL')
 * 
 *     klass = _array_classes[data_type.id()]             # <<<<<<<<<<<<<<
 * 
 *     cdef Array arr = klass.__new__(klass)
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__array_classes == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(17, 200, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_data_type->id()); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__array_classes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_klass = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":202
 *     klass = _array_classes[data_type.id()]
 * 
 *     cdef Array arr = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *     arr.init(sp_array)
 *     return arr
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_klass) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_klass);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(17, 202, __pyx_L1_error)
  __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":203
 * 
 *     cdef Array arr = klass.__new__(klass)
 *     arr.init(sp_array)             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_arr->__pyx_vtab)->init(__pyx_v_arr, __pyx_v_sp_array); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 203, __pyx_L1_error)

  /* "pyarrow/public-api.pxi":204
 *     cdef Array arr = klass.__new__(klass)
 *     arr.init(sp_array)
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":191
 * 
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":207
 * 
 * 
 * cdef api object pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(std::shared_ptr< arrow::ChunkedArray>  const &__pyx_v_sp_array) {
   arrow::DataType *__pyx_v_data_type;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_chunked_array", 0);

  /* "pyarrow/public-api.pxi":209
 * cdef api object pyarrow_wrap_chunked_array(
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_array.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":210
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('ChunkedArray was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__258, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 210, __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(17, 210, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":209
 * cdef api object pyarrow_wrap_chunked_array(
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":212
 *         raise ValueError('ChunkedArray was NULL')
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()             # <<<<<<<<<<<<<<
 * 
 *     if data_type == NULL:
 */
  __pyx_v_data_type = __pyx_v_sp_array.get()->type().get();

  /* "pyarrow/public-api.pxi":214
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_type == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":215
 * 
 *     if data_type == NULL:
 *         raise ValueError('ChunkedArray data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__259, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 215, __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(17, 215, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":214
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":217
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)             # <<<<<<<<<<<<<<
 *     arr.init(sp_array)
 *     return arr
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ChunkedArray(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ChunkedArray), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 217, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":218
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 *     arr.init(sp_array)             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *)__pyx_v_arr->__pyx_vtab)->init(__pyx_v_arr, __pyx_v_sp_array);

  /* "pyarrow/public-api.pxi":219
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 *     arr.init(sp_array)
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":207
 * 
 * 
 * cdef api object pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_chunked_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":221
 *     return arr
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')
 */

static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar) {
   arrow::DataType *__pyx_v_data_type;
  PyObject *__pyx_v_klass = NULL;
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_scalar = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_scalar", 0);

  /* "pyarrow/public-api.pxi":222
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_scalar.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":223
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__260, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 223, __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(17, 223, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":222
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":225
 *         raise ValueError('Scalar was NULL')
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()             # <<<<<<<<<<<<<<
 * 
 *     if data_type == NULL:
 */
  __pyx_v_data_type = __pyx_v_sp_scalar.get()->type.get();

  /* "pyarrow/public-api.pxi":227
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar data type was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_type == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":228
 * 
 *     if data_type == NULL:
 *         raise ValueError('Scalar data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _scalar_classes[data_type.id()]
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__261, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 228, __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(17, 228, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":227
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":230
 *         raise ValueError('Scalar data type was NULL')
 * 
 *     klass = _scalar_classes[data_type.id()]             # <<<<<<<<<<<<<<
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__scalar_classes == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(17, 230, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_data_type->id()); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__scalar_classes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_klass = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":232
 *     klass = _scalar_classes[data_type.id()]
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *     scalar.init(sp_scalar)
 *     return scalar
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_klass) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_klass);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ScalarValue))))) __PYX_ERR(17, 232, __pyx_L1_error)
  __pyx_v_scalar = ((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":233
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)
 *     scalar.init(sp_scalar)             # <<<<<<<<<<<<<<
 *     return scalar
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue *)__pyx_v_scalar->__pyx_vtab)->init(__pyx_v_scalar, __pyx_v_sp_scalar);

  /* "pyarrow/public-api.pxi":234
 *     cdef ScalarValue scalar = klass.__new__(klass)
 *     scalar.init(sp_scalar)
 *     return scalar             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_scalar));
  __pyx_r = ((PyObject *)__pyx_v_scalar);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":221
 *     return arr
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF((PyObject *)__pyx_v_scalar);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":237
 * 
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(tensor, Tensor)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_tensor(PyObject *__pyx_v_tensor) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_tensor", 0);

  /* "pyarrow/public-api.pxi":238
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):
 *     return isinstance(tensor, Tensor)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tensor, __pyx_ptype_7pyarrow_3lib_Tensor); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":237
 * 
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(tensor, Tensor)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":241
 * 
 * 
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 */

std::shared_ptr< arrow::Tensor>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(PyObject *__pyx_v_tensor) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_ten = 0;
  std::shared_ptr< arrow::Tensor>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_tensor", 0);

  /* "pyarrow/public-api.pxi":243
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):             # <<<<<<<<<<<<<<
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_tensor(__pyx_v_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":244
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 *         ten = <Tensor>(tensor)             # <<<<<<<<<<<<<<
 *         return ten.sp_tensor
 * 
 */
    __pyx_t_2 = __pyx_v_tensor;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_ten = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":245
 *     if pyarrow_is_tensor(tensor):
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CTensor]()
 */
    __pyx_r = __pyx_v_ten->sp_tensor;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":243
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):             # <<<<<<<<<<<<<<
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor
 */
  }

  /* "pyarrow/public-api.pxi":247
 *         return ten.sp_tensor
 * 
 *     return shared_ptr[CTensor]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Tensor> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":241
 * 
 * 
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ten);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":250
 * 
 * 
 * cdef api object pyarrow_wrap_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(std::shared_ptr< arrow::Tensor>  const &__pyx_v_sp_tensor) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_tensor", 0);

  /* "pyarrow/public-api.pxi":252
 * cdef api object pyarrow_wrap_tensor(
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tensor was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_tensor.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":253
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 *         raise ValueError('Tensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__262, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 253, __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(17, 253, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":252
 * cdef api object pyarrow_wrap_tensor(
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tensor was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":255
 *         raise ValueError('Tensor was NULL')
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)             # <<<<<<<<<<<<<<
 *     tensor.init(sp_tensor)
 *     return tensor
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Tensor(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Tensor), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 255, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_tensor = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":256
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 *     tensor.init(sp_tensor)             # <<<<<<<<<<<<<<
 *     return tensor
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Tensor *)__pyx_v_tensor->__pyx_vtab)->init(__pyx_v_tensor, __pyx_v_sp_tensor);

  /* "pyarrow/public-api.pxi":257
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 *     tensor.init(sp_tensor)
 *     return tensor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_tensor));
  __pyx_r = ((PyObject *)__pyx_v_tensor);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":250
 * 
 * 
 * cdef api object pyarrow_wrap_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tensor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":260
 * 
 * 
 * cdef api bint pyarrow_is_sparse_tensor_coo(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseTensorCOO)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_coo(PyObject *__pyx_v_sparse_tensor) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_sparse_tensor_coo", 0);

  /* "pyarrow/public-api.pxi":261
 * 
 * cdef api bint pyarrow_is_sparse_tensor_coo(object sparse_tensor):
 *     return isinstance(sparse_tensor, SparseTensorCOO)             # <<<<<<<<<<<<<<
 * 
 * cdef api shared_ptr[CSparseTensorCOO] pyarrow_unwrap_sparse_tensor_coo(
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_sparse_tensor, __pyx_ptype_7pyarrow_3lib_SparseTensorCOO); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":260
 * 
 * 
 * cdef api bint pyarrow_is_sparse_tensor_coo(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseTensorCOO)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":263
 *     return isinstance(sparse_tensor, SparseTensorCOO)
 * 
 * cdef api shared_ptr[CSparseTensorCOO] pyarrow_unwrap_sparse_tensor_coo(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseTensorCOO sten
 */

std::shared_ptr< arrow::SparseTensorCOO>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_tensor_coo(PyObject *__pyx_v_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_sten = 0;
  std::shared_ptr< arrow::SparseTensorCOO>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_sparse_tensor_coo", 0);

  /* "pyarrow/public-api.pxi":266
 *         object sparse_tensor):
 *     cdef SparseTensorCOO sten
 *     if pyarrow_is_sparse_tensor_coo(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseTensorCOO>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_coo(__pyx_v_sparse_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":267
 *     cdef SparseTensorCOO sten
 *     if pyarrow_is_sparse_tensor_coo(sparse_tensor):
 *         sten = <SparseTensorCOO>(sparse_tensor)             # <<<<<<<<<<<<<<
 *         return sten.sp_sparse_tensor
 * 
 */
    __pyx_t_2 = __pyx_v_sparse_tensor;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_sten = ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":268
 *     if pyarrow_is_sparse_tensor_coo(sparse_tensor):
 *         sten = <SparseTensorCOO>(sparse_tensor)
 *         return sten.sp_sparse_tensor             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CSparseTensorCOO]()
 */
    __pyx_r = __pyx_v_sten->sp_sparse_tensor;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":266
 *         object sparse_tensor):
 *     cdef SparseTensorCOO sten
 *     if pyarrow_is_sparse_tensor_coo(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseTensorCOO>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  }

  /* "pyarrow/public-api.pxi":270
 *         return sten.sp_sparse_tensor
 * 
 *     return shared_ptr[CSparseTensorCOO]()             # <<<<<<<<<<<<<<
 * 
 * cdef api object pyarrow_wrap_sparse_tensor_coo(
 */
  __pyx_r = std::shared_ptr< arrow::SparseTensorCOO> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":263
 *     return isinstance(sparse_tensor, SparseTensorCOO)
 * 
 * cdef api shared_ptr[CSparseTensorCOO] pyarrow_unwrap_sparse_tensor_coo(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseTensorCOO sten
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sten);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":272
 *     return shared_ptr[CSparseTensorCOO]()
 * 
 * cdef api object pyarrow_wrap_sparse_tensor_coo(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_coo(std::shared_ptr< arrow::SparseTensorCOO>  const &__pyx_v_sp_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *__pyx_v_sparse_tensor = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_sparse_tensor_coo", 0);

  /* "pyarrow/public-api.pxi":274
 * cdef api object pyarrow_wrap_sparse_tensor_coo(
 *         const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseTensorCOO was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_sparse_tensor.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":275
 *         const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseTensorCOO was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseTensorCOO sparse_tensor = SparseTensorCOO.__new__(
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__263, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 275, __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(17, 275, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":274
 * cdef api object pyarrow_wrap_sparse_tensor_coo(
 *         const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseTensorCOO was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":277
 *         raise ValueError('SparseTensorCOO was NULL')
 * 
 *     cdef SparseTensorCOO sparse_tensor = SparseTensorCOO.__new__(             # <<<<<<<<<<<<<<
 *         SparseTensorCOO)
 *     sparse_tensor.init(sp_sparse_tensor)
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_SparseTensorCOO(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 277, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_sparse_tensor = ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":279
 *     cdef SparseTensorCOO sparse_tensor = SparseTensorCOO.__new__(
 *         SparseTensorCOO)
 *     sparse_tensor.init(sp_sparse_tensor)             # <<<<<<<<<<<<<<
 *     return sparse_tensor
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCOO *)__pyx_v_sparse_tensor->__pyx_vtab)->init(__pyx_v_sparse_tensor, __pyx_v_sp_sparse_tensor);

  /* "pyarrow/public-api.pxi":280
 *         SparseTensorCOO)
 *     sparse_tensor.init(sp_sparse_tensor)
 *     return sparse_tensor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_sparse_tensor));
  __pyx_r = ((PyObject *)__pyx_v_sparse_tensor);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":272
 *     return shared_ptr[CSparseTensorCOO]()
 * 
 * cdef api object pyarrow_wrap_sparse_tensor_coo(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_sparse_tensor_coo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sparse_tensor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":283
 * 
 * 
 * cdef api bint pyarrow_is_sparse_tensor_csr(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseTensorCSR)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_csr(PyObject *__pyx_v_sparse_tensor) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_sparse_tensor_csr", 0);

  /* "pyarrow/public-api.pxi":284
 * 
 * cdef api bint pyarrow_is_sparse_tensor_csr(object sparse_tensor):
 *     return isinstance(sparse_tensor, SparseTensorCSR)             # <<<<<<<<<<<<<<
 * 
 * cdef api shared_ptr[CSparseTensorCSR] pyarrow_unwrap_sparse_tensor_csr(
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_sparse_tensor, __pyx_ptype_7pyarrow_3lib_SparseTensorCSR); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":283
 * 
 * 
 * cdef api bint pyarrow_is_sparse_tensor_csr(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseTensorCSR)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":286
 *     return isinstance(sparse_tensor, SparseTensorCSR)
 * 
 * cdef api shared_ptr[CSparseTensorCSR] pyarrow_unwrap_sparse_tensor_csr(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseTensorCSR sten
 */

std::shared_ptr< arrow::SparseTensorCSR>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_tensor_csr(PyObject *__pyx_v_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_sten = 0;
  std::shared_ptr< arrow::SparseTensorCSR>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_sparse_tensor_csr", 0);

  /* "pyarrow/public-api.pxi":289
 *         object sparse_tensor):
 *     cdef SparseTensorCSR sten
 *     if pyarrow_is_sparse_tensor_csr(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseTensorCSR>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_csr(__pyx_v_sparse_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":290
 *     cdef SparseTensorCSR sten
 *     if pyarrow_is_sparse_tensor_csr(sparse_tensor):
 *         sten = <SparseTensorCSR>(sparse_tensor)             # <<<<<<<<<<<<<<
 *         return sten.sp_sparse_tensor
 * 
 */
    __pyx_t_2 = __pyx_v_sparse_tensor;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_sten = ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":291
 *     if pyarrow_is_sparse_tensor_csr(sparse_tensor):
 *         sten = <SparseTensorCSR>(sparse_tensor)
 *         return sten.sp_sparse_tensor             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CSparseTensorCSR]()
 */
    __pyx_r = __pyx_v_sten->sp_sparse_tensor;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":289
 *         object sparse_tensor):
 *     cdef SparseTensorCSR sten
 *     if pyarrow_is_sparse_tensor_csr(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseTensorCSR>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  }

  /* "pyarrow/public-api.pxi":293
 *         return sten.sp_sparse_tensor
 * 
 *     return shared_ptr[CSparseTensorCSR]()             # <<<<<<<<<<<<<<
 * 
 * cdef api object pyarrow_wrap_sparse_tensor_csr(
 */
  __pyx_r = std::shared_ptr< arrow::SparseTensorCSR> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":286
 *     return isinstance(sparse_tensor, SparseTensorCSR)
 * 
 * cdef api shared_ptr[CSparseTensorCSR] pyarrow_unwrap_sparse_tensor_csr(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseTensorCSR sten
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sten);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":295
 *     return shared_ptr[CSparseTensorCSR]()
 * 
 * cdef api object pyarrow_wrap_sparse_tensor_csr(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_csr(std::shared_ptr< arrow::SparseTensorCSR>  const &__pyx_v_sp_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *__pyx_v_sparse_tensor = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_sparse_tensor_csr", 0);

  /* "pyarrow/public-api.pxi":297
 * cdef api object pyarrow_wrap_sparse_tensor_csr(
 *         const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseTensorCSR was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_sparse_tensor.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":298
 *         const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseTensorCSR was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseTensorCSR sparse_tensor = SparseTensorCSR.__new__(
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__264, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 298, __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(17, 298, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":297
 * cdef api object pyarrow_wrap_sparse_tensor_csr(
 *         const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseTensorCSR was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":300
 *         raise ValueError('SparseTensorCSR was NULL')
 * 
 *     cdef SparseTensorCSR sparse_tensor = SparseTensorCSR.__new__(             # <<<<<<<<<<<<<<
 *         SparseTensorCSR)
 *     sparse_tensor.init(sp_sparse_tensor)
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_SparseTensorCSR(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 300, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_sparse_tensor = ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":302
 *     cdef SparseTensorCSR sparse_tensor = SparseTensorCSR.__new__(
 *         SparseTensorCSR)
 *     sparse_tensor.init(sp_sparse_tensor)             # <<<<<<<<<<<<<<
 *     return sparse_tensor
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCSR *)__pyx_v_sparse_tensor->__pyx_vtab)->init(__pyx_v_sparse_tensor, __pyx_v_sp_sparse_tensor);

  /* "pyarrow/public-api.pxi":303
 *         SparseTensorCSR)
 *     sparse_tensor.init(sp_sparse_tensor)
 *     return sparse_tensor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_sparse_tensor));
  __pyx_r = ((PyObject *)__pyx_v_sparse_tensor);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":295
 *     return shared_ptr[CSparseTensorCSR]()
 * 
 * cdef api object pyarrow_wrap_sparse_tensor_csr(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_sparse_tensor_csr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sparse_tensor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":306
 * 
 * 
 * cdef api bint pyarrow_is_table(object table):             # <<<<<<<<<<<<<<
 *     return isinstance(table, Table)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_table(PyObject *__pyx_v_table) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_table", 0);

  /* "pyarrow/public-api.pxi":307
 * 
 * cdef api bint pyarrow_is_table(object table):
 *     return isinstance(table, Table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_table, __pyx_ptype_7pyarrow_3lib_Table); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":306
 * 
 * 
 * cdef api bint pyarrow_is_table(object table):             # <<<<<<<<<<<<<<
 *     return isinstance(table, Table)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":310
 * 
 * 
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):             # <<<<<<<<<<<<<<
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 */

std::shared_ptr< arrow::Table>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_table(PyObject *__pyx_v_table) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_tab = 0;
  std::shared_ptr< arrow::Table>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_table", 0);

  /* "pyarrow/public-api.pxi":312
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):
 *     cdef Table tab
 *     if pyarrow_is_table(table):             # <<<<<<<<<<<<<<
 *         tab = <Table>(table)
 *         return tab.sp_table
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_table(__pyx_v_table) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":313
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 *         tab = <Table>(table)             # <<<<<<<<<<<<<<
 *         return tab.sp_table
 * 
 */
    __pyx_t_2 = __pyx_v_table;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_tab = ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":314
 *     if pyarrow_is_table(table):
 *         tab = <Table>(table)
 *         return tab.sp_table             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CTable]()
 */
    __pyx_r = __pyx_v_tab->sp_table;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":312
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):
 *     cdef Table tab
 *     if pyarrow_is_table(table):             # <<<<<<<<<<<<<<
 *         tab = <Table>(table)
 *         return tab.sp_table
 */
  }

  /* "pyarrow/public-api.pxi":316
 *         return tab.sp_table
 * 
 *     return shared_ptr[CTable]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Table> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":310
 * 
 * 
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):             # <<<<<<<<<<<<<<
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tab);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":319
 * 
 * 
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_table(std::shared_ptr< arrow::Table>  const &__pyx_v_ctable) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_table", 0);

  /* "pyarrow/public-api.pxi":321
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())             # <<<<<<<<<<<<<<
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_ctable.get()->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(17, 321, __pyx_L1_error)

  /* "pyarrow/public-api.pxi":322
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 *     cdef Table table = Table.__new__(Table)             # <<<<<<<<<<<<<<
 *     table.init(ctable)
 *     return table
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Table(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 322, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":323
 *     check_status(ctable.get().Validate())
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)             # <<<<<<<<<<<<<<
 *     return table
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Table *)__pyx_v_table->__pyx_vtab)->init(__pyx_v_table, __pyx_v_ctable);

  /* "pyarrow/public-api.pxi":324
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)
 *     return table             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_table));
  __pyx_r = ((PyObject *)__pyx_v_table);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":319
 * 
 * 
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":327
 * 
 * 
 * cdef api bint pyarrow_is_batch(object batch):             # <<<<<<<<<<<<<<
 *     return isinstance(batch, RecordBatch)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_batch(PyObject *__pyx_v_batch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_batch", 0);

  /* "pyarrow/public-api.pxi":328
 * 
 * cdef api bint pyarrow_is_batch(object batch):
 *     return isinstance(batch, RecordBatch)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_batch, __pyx_ptype_7pyarrow_3lib_RecordBatch); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":327
 * 
 * 
 * cdef api bint pyarrow_is_batch(object batch):             # <<<<<<<<<<<<<<
 *     return isinstance(batch, RecordBatch)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":331
 * 
 * 
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):             # <<<<<<<<<<<<<<
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 */

std::shared_ptr< arrow::RecordBatch>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch(PyObject *__pyx_v_batch) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_bat = 0;
  std::shared_ptr< arrow::RecordBatch>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_batch", 0);

  /* "pyarrow/public-api.pxi":333
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):             # <<<<<<<<<<<<<<
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_batch(__pyx_v_batch) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":334
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 *         bat = <RecordBatch>(batch)             # <<<<<<<<<<<<<<
 *         return bat.sp_batch
 * 
 */
    __pyx_t_2 = __pyx_v_batch;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_bat = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":335
 *     if pyarrow_is_batch(batch):
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CRecordBatch]()
 */
    __pyx_r = __pyx_v_bat->sp_batch;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":333
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):             # <<<<<<<<<<<<<<
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch
 */
  }

  /* "pyarrow/public-api.pxi":337
 *         return bat.sp_batch
 * 
 *     return shared_ptr[CRecordBatch]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::RecordBatch> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":331
 * 
 * 
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):             # <<<<<<<<<<<<<<
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_bat);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":340
 * 
 * 
 * cdef api object pyarrow_wrap_batch(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(std::shared_ptr< arrow::RecordBatch>  const &__pyx_v_cbatch) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_batch", 0);

  /* "pyarrow/public-api.pxi":342
 * cdef api object pyarrow_wrap_batch(
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)             # <<<<<<<<<<<<<<
 *     batch.init(cbatch)
 *     return batch
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_RecordBatch(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 342, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_batch = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":343
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 *     batch.init(cbatch)             # <<<<<<<<<<<<<<
 *     return batch
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch *)__pyx_v_batch->__pyx_vtab)->init(__pyx_v_batch, __pyx_v_cbatch);

  /* "pyarrow/public-api.pxi":344
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 *     batch.init(cbatch)
 *     return batch             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_batch));
  __pyx_r = ((PyObject *)__pyx_v_batch);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":340
 * 
 * 
 * cdef api object pyarrow_wrap_batch(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_batch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_211__pyx_unpickle__PandasAPIShim(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_210__pyx_unpickle__PandasAPIShim[] = "__pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_211__pyx_unpickle__PandasAPIShim = {"__pyx_unpickle__PandasAPIShim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_211__pyx_unpickle__PandasAPIShim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_210__pyx_unpickle__PandasAPIShim};
static PyObject *__pyx_pw_7pyarrow_3lib_211__pyx_unpickle__PandasAPIShim(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, 1); __PYX_ERR(9, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, 2); __PYX_ERR(9, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__PandasAPIShim") < 0)) __PYX_ERR(9, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_210__pyx_unpickle__PandasAPIShim(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_210__pyx_unpickle__PandasAPIShim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf939126:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xf939126) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf939126:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xf939126:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xf9, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xf939126:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasAPIShim), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf939126 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]
 *     if len(__pyx_state) > 15 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 15 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[15])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_array_like_types);
  __Pyx_DECREF(__pyx_v___pyx_result->_array_like_types);
  __pyx_v___pyx_result->_array_like_types = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_categorical_type);
  __Pyx_DECREF(__pyx_v___pyx_result->_categorical_type);
  __pyx_v___pyx_result->_categorical_type = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_compat_module);
  __Pyx_DECREF(__pyx_v___pyx_result->_compat_module);
  __pyx_v___pyx_result->_compat_module = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_data_frame);
  __Pyx_DECREF(__pyx_v___pyx_result->_data_frame);
  __pyx_v___pyx_result->_data_frame = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_datetimetz_type);
  __Pyx_DECREF(__pyx_v___pyx_result->_datetimetz_type);
  __pyx_v___pyx_result->_datetimetz_type = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_extension_array);
  __Pyx_DECREF(__pyx_v___pyx_result->_extension_array);
  __pyx_v___pyx_result->_extension_array = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_have_pandas = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_index);
  __Pyx_DECREF(__pyx_v___pyx_result->_index);
  __pyx_v___pyx_result->_index = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_loose_version);
  __Pyx_DECREF(__pyx_v___pyx_result->_loose_version);
  __pyx_v___pyx_result->_loose_version = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_pd);
  __Pyx_DECREF(__pyx_v___pyx_result->_pd);
  __pyx_v___pyx_result->_pd = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_series);
  __Pyx_DECREF(__pyx_v___pyx_result->_series);
  __pyx_v___pyx_result->_series = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_tried_importing_pandas = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_types_api);
  __Pyx_DECREF(__pyx_v___pyx_result->_types_api);
  __pyx_v___pyx_result->_types_api = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_version);
  __Pyx_DECREF(__pyx_v___pyx_result->_version);
  __pyx_v___pyx_result->_version = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->has_sparse = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]
 *     if len(__pyx_state) > 15 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[15])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 15) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]
 *     if len(__pyx_state) > 15 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[15])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]
 *     if len(__pyx_state) > 15 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[15])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]
 *     if len(__pyx_state) > 15 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_213__pyx_unpickle_Scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_212__pyx_unpickle_Scalar[] = "__pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_213__pyx_unpickle_Scalar = {"__pyx_unpickle_Scalar", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_213__pyx_unpickle_Scalar, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_212__pyx_unpickle_Scalar};
static PyObject *__pyx_pw_7pyarrow_3lib_213__pyx_unpickle_Scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, 1); __PYX_ERR(9, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, 2); __PYX_ERR(9, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Scalar") < 0)) __PYX_ERR(9, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_212__pyx_unpickle_Scalar(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_212__pyx_unpickle_Scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x599dcce) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x599dcce:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x59, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->type);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->type));
  __pyx_v___pyx_result->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_215__pyx_unpickle__PandasConvertible(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_214__pyx_unpickle__PandasConvertible[] = "__pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_215__pyx_unpickle__PandasConvertible = {"__pyx_unpickle__PandasConvertible", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_215__pyx_unpickle__PandasConvertible, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_214__pyx_unpickle__PandasConvertible};
static PyObject *__pyx_pw_7pyarrow_3lib_215__pyx_unpickle__PandasConvertible(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, 1); __PYX_ERR(9, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, 2); __PYX_ERR(9, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__PandasConvertible") < 0)) __PYX_ERR(9, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_214__pyx_unpickle__PandasConvertible(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_214__pyx_unpickle__PandasConvertible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xd41d8cd:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasConvertible), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_2 > 0) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 13, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_217__pyx_unpickle_SerializationContext(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_216__pyx_unpickle_SerializationContext[] = "__pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_217__pyx_unpickle_SerializationContext = {"__pyx_unpickle_SerializationContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_217__pyx_unpickle_SerializationContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_216__pyx_unpickle_SerializationContext};
static PyObject *__pyx_pw_7pyarrow_3lib_217__pyx_unpickle_SerializationContext(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SerializationContext", 1, 3, 3, 1); __PYX_ERR(9, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SerializationContext", 1, 3, 3, 2); __PYX_ERR(9, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SerializationContext") < 0)) __PYX_ERR(9, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SerializationContext", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_216__pyx_unpickle_SerializationContext(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_216__pyx_unpickle_SerializationContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x9aeed6f) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->custom_deserializers);
  __Pyx_DECREF(__pyx_v___pyx_result->custom_deserializers);
  __pyx_v___pyx_result->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->custom_serializers);
  __Pyx_DECREF(__pyx_v___pyx_result->custom_serializers);
  __pyx_v___pyx_result->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pickle_deserializer);
  __Pyx_DECREF(__pyx_v___pyx_result->pickle_deserializer);
  __pyx_v___pyx_result->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pickle_serializer);
  __Pyx_DECREF(__pyx_v___pyx_result->pickle_serializer);
  __pyx_v___pyx_result->pickle_serializer = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->type_to_type_id);
  __Pyx_DECREF(__pyx_v___pyx_result->type_to_type_id);
  __pyx_v___pyx_result->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->types_to_pickle);
  __Pyx_DECREF(__pyx_v___pyx_result->types_to_pickle);
  __pyx_v___pyx_result->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->whitelisted_types);
  __Pyx_DECREF(__pyx_v___pyx_result->whitelisted_types);
  __pyx_v___pyx_result->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 7) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/includes/common.pxd":82
 *     T GetResultValue[T](CResult[T]) except *
 * 
 * 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":84
 * 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":85
 *     # 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":86
 *     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":82
 *     T GetResultValue[T](CResult[T]) except *
 * 
 * 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;
}

/* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);

  /* "string.to_py":32
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);

  /* "string.to_py":38
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);

  /* "string.to_py":44
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);

  /* "string.to_py":50
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);

  /* "string.to_py":56
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":14
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0             # <<<<<<<<<<<<<<
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)
 */
  __pyx_v_length = 0;

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(9, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  goto __pyx_L0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_uint8_t")
 * cdef object __pyx_convert_vector_to_py_uint8_t(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_uint8_t(const std::vector<uint8_t>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_uint8_t", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_uint8_t")
 * cdef object __pyx_convert_vector_to_py_uint8_t(vector[X]& v):
 *     return [v[i] for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = __Pyx_PyInt_From_uint8_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(9, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_uint8_t")
 * cdef object __pyx_convert_vector_to_py_uint8_t(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "set.from_py":108
 * 
 * @cname("__pyx_convert_unordered_set_from_py_std_3a__3a_string")
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef set[X] s
 *     for item in o:
 */

static std::unordered_set<std::string>  __pyx_convert_unordered_set_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::unordered_set<std::string>  __pyx_v_s;
  PyObject *__pyx_v_item = NULL;
  std::unordered_set<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_unordered_set_from_py_std_3a__3a_string", 0);

  /* "set.from_py":110
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:
 *     cdef set[X] s
 *     for item in o:             # <<<<<<<<<<<<<<
 *         s.insert(<X>item)
 *     return s
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 110, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 110, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 110, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 110, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 110, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(9, 110, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "set.from_py":111
 *     cdef set[X] s
 *     for item in o:
 *         s.insert(<X>item)             # <<<<<<<<<<<<<<
 *     return s
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 111, __pyx_L1_error)
    __pyx_v_s.insert(((std::string)__pyx_t_5));

    /* "set.from_py":110
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:
 *     cdef set[X] s
 *     for item in o:             # <<<<<<<<<<<<<<
 *         s.insert(<X>item)
 *     return s
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "set.from_py":112
 *     for item in o:
 *         s.insert(<X>item)
 *     return s             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "set.from_py":108
 * 
 * @cname("__pyx_convert_unordered_set_from_py_std_3a__3a_string")
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef set[X] s
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("set.from_py.__pyx_convert_unordered_set_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;
}

/* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(const std::vector<std::string>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_string", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v):
 *     return [v[i] for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(9, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_convert_vector_to_py_int64_t(const std::vector<int64_t>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int64_t", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_int64_t")
 * cdef object __pyx_convert_vector_to_py_int64_t(vector[X]& v):
 *     return [v[i] for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = __Pyx_PyInt_From_int64_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(9, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_int64_t")
 * cdef object __pyx_convert_vector_to_py_int64_t(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "map.from_py":174
 * 
 * @cname("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef map[X,Y] __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef dict d = o
 *     cdef map[X,Y] m
 */

static std::unordered_map<std::string,std::string>  __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *__pyx_v_o) {
  PyObject *__pyx_v_d = 0;
  std::unordered_map<std::string,std::string>  __pyx_v_m;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  std::unordered_map<std::string,std::string>  __pyx_r;
  __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;
  std::string __pyx_t_8;
  std::string __pyx_t_9;
  __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string", 0);

  /* "map.from_py":175
 * @cname("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef map[X,Y] __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
 *     cdef dict d = o             # <<<<<<<<<<<<<<
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_o))||((__pyx_v_o) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_o)->tp_name), 0))) __PYX_ERR(9, 175, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_o;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "map.from_py":177
 *     cdef dict d = o
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():             # <<<<<<<<<<<<<<
 *         m.insert(pair[X,Y](<X>key, <Y>value))
 *     return m
 */
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_d == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(9, 177, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 177, __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(9, 177, __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_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "map.from_py":178
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():
 *         m.insert(pair[X,Y](<X>key, <Y>value))             # <<<<<<<<<<<<<<
 *     return m
 * 
 */
    __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 178, __pyx_L1_error)
    __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 178, __pyx_L1_error)
    __pyx_v_m.insert(std::pair<std::string,std::string> (((std::string)__pyx_t_8), ((std::string)__pyx_t_9)));
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "map.from_py":179
 *     for key, value in d.iteritems():
 *         m.insert(pair[X,Y](<X>key, <Y>value))
 *     return m             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_m;
  goto __pyx_L0;

  /* "map.from_py":174
 * 
 * @cname("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef map[X,Y] __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef dict d = o
 *     cdef map[X,Y] m
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("map.from_py.__pyx_convert_unordered_map_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_d);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::vector<std::string>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 47, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(9, 47, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":48
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 48, __pyx_L1_error)
    __pyx_v_v.push_back(((std::string)__pyx_t_5));

    /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":49
 *     for item in o:
 *         v.push_back(<X>item)
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_7pyarrow_3lib_Message(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Message *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Message *)o);
  new((void*)&(p->message)) std::unique_ptr< arrow::ipc::Message> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_7Message_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Message(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Message *p = (struct __pyx_obj_7pyarrow_3lib_Message *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->message);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_8metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_4body_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Message[] = {
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_5equals, METH_O, __pyx_doc_7pyarrow_3lib_7Message_4equals},
  {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_7Message_7serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_7Message_6serialize_to},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_7Message_9serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_7Message_8serialize},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_13__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_7Message_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_15__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_7Message_14__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Message[] = {
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_7Message_type, 0, (char *)0, 0},
  {(char *)"metadata", __pyx_getprop_7pyarrow_3lib_7Message_metadata, 0, (char *)0, 0},
  {(char *)"body", __pyx_getprop_7pyarrow_3lib_7Message_body, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Message = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Message", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Message, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_7Message_11__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*/
  "Message()\n\n    Container for an Arrow IPC message with metadata and optional body\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Message, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Message, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_7Message_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Message, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool __pyx_vtable_7pyarrow_3lib_MemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryPool(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MemoryPool[] = {
  {"bytes_allocated", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_2bytes_allocated},
  {"max_memory", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_4max_memory},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10MemoryPool_8__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "MemoryPool()\n\n    Base class for memory allocation.\n\n    Besides tracking its number of allocated bytes, a memory pool also\n    takes care of the required 64-byte alignment for Arrow data.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_10MemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_vtable_7pyarrow_3lib_DataType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DataType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DataType *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DataType *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_DataType;
  new((void*)&(p->sp_type)) std::shared_ptr< arrow::DataType> ();
  p->pep3118_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_8DataType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DataType(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DataType *p = (struct __pyx_obj_7pyarrow_3lib_DataType *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  __Pyx_call_destructor(p->sp_type);
  Py_CLEAR(p->pep3118_format);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_DataType(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_8DataType_13__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_8DataType_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_3lib_8DataType_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_2id_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8DataType_bit_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_9bit_width_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8DataType_num_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_12num_children_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8DataType_num_buffers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_11num_buffers_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DataType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8DataType_9__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8DataType_8__reduce__},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_8DataType_15equals, METH_O, __pyx_doc_7pyarrow_3lib_8DataType_14equals},
  {"to_pandas_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8DataType_16to_pandas_dtype},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DataType[] = {
  {(char *)"id", __pyx_getprop_7pyarrow_3lib_8DataType_id, 0, (char *)0, 0},
  {(char *)"bit_width", __pyx_getprop_7pyarrow_3lib_8DataType_bit_width, 0, (char *)0, 0},
  {(char *)"num_children", __pyx_getprop_7pyarrow_3lib_8DataType_num_children, 0, (char *)"\n        The number of child fields.\n        ", 0},
  {(char *)"num_buffers", __pyx_getprop_7pyarrow_3lib_8DataType_num_buffers, 0, (char *)"\n        Number of data buffers required to construct Array type\n        excluding children\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DataType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DataType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_8DataType_7__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "DataType()\n\n    Base class of all Arrow data types.\n\n    Each data type is an *instance* of this class.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_DataType, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DataType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DataType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DataType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListType __pyx_vtable_7pyarrow_3lib_ListType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_ListType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8ListType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8ListType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8ListType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListType[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_8ListType_value_type, 0, (char *)"\n        The data type of list values.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for list data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType __pyx_vtable_7pyarrow_3lib_LargeListType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeListType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeListType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_LargeListType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13LargeListType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13LargeListType_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeListType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13LargeListType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13LargeListType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_LargeListType[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_13LargeListType_value_type, 0, (char *)"\n        The data type of large list values.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeListType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeListType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for large list data types\n    (like ListType, but with 64-bit offsets).\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeListType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_LargeListType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeListType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructType __pyx_vtable_7pyarrow_3lib_StructType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_StructType;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_StructType(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10StructType_7__reduce__},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StructType = {
  __pyx_pw_7pyarrow_3lib_10StructType_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_StructType, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StructType = {
  __pyx_pw_7pyarrow_3lib_10StructType_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_10StructType_6__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StructType, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StructType, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for struct data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_10StructType_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryMemo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)o);
  new((void*)&(p->sp_memo)) std::shared_ptr< arrow::ipc::DictionaryMemo> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_14DictionaryMemo_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DictionaryMemo(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_memo);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryMemo[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14DictionaryMemo_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14DictionaryMemo_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryMemo = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryMemo", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DictionaryMemo, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Tracking container for dictionary-encoded fields\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryMemo, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryMemo, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType __pyx_vtable_7pyarrow_3lib_DictionaryType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_DictionaryType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_ordered(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_index_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14DictionaryType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14DictionaryType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryType[] = {
  {(char *)"ordered", __pyx_getprop_7pyarrow_3lib_14DictionaryType_ordered, 0, (char *)"\n        Whether the dictionary is ordered, i.e. whether the ordering of values\n        in the dictionary is important.\n        ", 0},
  {(char *)"index_type", __pyx_getprop_7pyarrow_3lib_14DictionaryType_index_type, 0, (char *)"\n        The data type of dictionary indices (a signed integer type).\n        ", 0},
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_14DictionaryType_value_type, 0, (char *)"\n        The dictionary value type. The dictionary values are found in an\n        instance of DictionaryArray\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for dictionary data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType __pyx_vtable_7pyarrow_3lib_TimestampType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_TimestampType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13TimestampType_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13TimestampType_tz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_TimestampType[] = {
  {"to_pandas_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13TimestampType_to_pandas_dtype},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13TimestampType_2__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_TimestampType[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_13TimestampType_unit, 0, (char *)"\n        The timestamp unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {(char *)"tz", __pyx_getprop_7pyarrow_3lib_13TimestampType_tz, 0, (char *)"\n        The timestamp time zone, if any, or None.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for timestamp data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_TimestampType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_TimestampType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type __pyx_vtable_7pyarrow_3lib_Time32Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Type *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Time32Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10Time32Type_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Time32Type[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_10Time32Type_unit, 0, (char *)"\n        The time unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for time32 data types.\n    ", /*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*/
  __pyx_getsets_7pyarrow_3lib_Time32Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type __pyx_vtable_7pyarrow_3lib_Time64Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Type *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Time64Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10Time64Type_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Time64Type[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_10Time64Type_unit, 0, (char *)"\n        The time unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for time64 data types.\n    ", /*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*/
  __pyx_getsets_7pyarrow_3lib_Time64Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_19FixedSizeBinaryType_byte_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBinaryType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19FixedSizeBinaryType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FixedSizeBinaryType[] = {
  {(char *)"byte_width", __pyx_getprop_7pyarrow_3lib_19FixedSizeBinaryType_byte_width, 0, (char *)"\n        The binary size in bytes.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for fixed-size binary data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeBinaryType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FixedSizeBinaryType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type __pyx_vtable_7pyarrow_3lib_Decimal128Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Decimal128Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Decimal128Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14Decimal128Type_precision(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14Decimal128Type_scale(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Decimal128Type[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14Decimal128Type_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14Decimal128Type___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Decimal128Type[] = {
  {(char *)"precision", __pyx_getprop_7pyarrow_3lib_14Decimal128Type_precision, 0, (char *)"\n        The decimal precision, in number of decimal digits (an integer).\n        ", 0},
  {(char *)"scale", __pyx_getprop_7pyarrow_3lib_14Decimal128Type_scale, 0, (char *)"\n        The decimal scale (an integer).\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Decimal128Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Decimal128Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for decimal128 data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Decimal128Type, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Decimal128Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Decimal128Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_vtable_7pyarrow_3lib_BaseExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BaseExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_17BaseExtensionType_extension_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_17BaseExtensionType_14extension_name_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_17BaseExtensionType_storage_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_17BaseExtensionType_12storage_type_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_BaseExtensionType[] = {
  {(char *)"extension_name", __pyx_getprop_7pyarrow_3lib_17BaseExtensionType_extension_name, 0, (char *)"\n        The extension type name.\n        ", 0},
  {(char *)"storage_type", __pyx_getprop_7pyarrow_3lib_17BaseExtensionType_storage_type, 0, (char *)"\n        The underlying storage type.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BaseExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BaseExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete base class for extension types.\n    ", /*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*/
  __pyx_getsets_7pyarrow_3lib_BaseExtensionType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BaseExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType __pyx_vtable_7pyarrow_3lib_ExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_BaseExtensionType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_ExtensionType;
  if (unlikely(__pyx_pw_7pyarrow_3lib_13ExtensionType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ExtensionType(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_13ExtensionType_5__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_13ExtensionType_5__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 PyMethodDef __pyx_methods_7pyarrow_3lib_ExtensionType[] = {
  {"__arrow_ext_serialize__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13ExtensionType_7__arrow_ext_serialize__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__},
  {"__arrow_ext_deserialize__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13ExtensionType_9__arrow_ext_deserialize__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "ExtensionType(DataType storage_type, extension_name)\n\n    Concrete base class for Python-defined extension types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ExtensionType, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ExtensionType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_13ExtensionType_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType __pyx_vtable_7pyarrow_3lib_PyExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_PyExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_PyExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ExtensionType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_PyExtensionType;
  if (unlikely(__pyx_pw_7pyarrow_3lib_15PyExtensionType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_PyExtensionType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15PyExtensionType_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15PyExtensionType_4__reduce__},
  {"__arrow_ext_serialize__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15PyExtensionType_7__arrow_ext_serialize__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__},
  {"__arrow_ext_deserialize__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15PyExtensionType_9__arrow_ext_deserialize__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_PyExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.PyExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_PyExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "PyExtensionType(DataType storage_type)\n\n    Concrete base class for Python-defined extension types based on pickle\n    for (de)serialization.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_PyExtensionType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15PyExtensionType_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_PyExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Field __pyx_vtable_7pyarrow_3lib_Field;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Field(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Field *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Field *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Field;
  new((void*)&(p->sp_field)) std::shared_ptr< arrow::Field> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_5Field_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Field(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Field *p = (struct __pyx_obj_7pyarrow_3lib_Field *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_field);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Field(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Field *p = (struct __pyx_obj_7pyarrow_3lib_Field *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Field(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Field *p = (struct __pyx_obj_7pyarrow_3lib_Field *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Field(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_5Field_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_5Field_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_3lib_5Field_nullable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_8nullable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Field_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_4name_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Field_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Field_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Field[] = {
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_5equals, METH_O, __pyx_doc_7pyarrow_3lib_5Field_4equals},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_9__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_8__reduce__},
  {"add_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_17add_metadata, METH_O, __pyx_doc_7pyarrow_3lib_5Field_16add_metadata},
  {"with_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_19with_metadata, METH_O, __pyx_doc_7pyarrow_3lib_5Field_18with_metadata},
  {"remove_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_21remove_metadata, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_20remove_metadata},
  {"flatten", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_23flatten, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_22flatten},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Field[] = {
  {(char *)"nullable", __pyx_getprop_7pyarrow_3lib_5Field_nullable, 0, (char *)0, 0},
  {(char *)"name", __pyx_getprop_7pyarrow_3lib_5Field_name, 0, (char *)0, 0},
  {(char *)"metadata", __pyx_getprop_7pyarrow_3lib_5Field_metadata, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_5Field_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Field = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Field", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Field, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Field_13__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_5Field_15__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_5Field_11__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Field()\n\n    A named field, with a data type, nullability, and optional metadata.\n\n    Notes\n    -----\n    Do not use this class's constructor directly; use pyarrow.field\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Field, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Field, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Field, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Field, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Field, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Field_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Field, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Schema __pyx_vtable_7pyarrow_3lib_Schema;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Schema(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Schema *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Schema *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Schema;
  new((void*)&(p->sp_schema)) std::shared_ptr< arrow::Schema> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_6Schema_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Schema(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Schema *p = (struct __pyx_obj_7pyarrow_3lib_Schema *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_schema);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Schema(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Schema(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Schema_16__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Schema_16__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_3lib_6Schema_pandas_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_5names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_types(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Schema[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_12__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_11__reduce__},
  {"empty_table", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_18empty_table, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_17empty_table},
  {"equals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_20equals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_19equals},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_22from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_21from_pandas},
  {"field", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_24field, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_23field},
  {"_field", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_26_field, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_25_field},
  {"field_by_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_28field_by_name, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_27field_by_name},
  {"get_field_index", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_30get_field_index, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_29get_field_index},
  {"append", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_32append, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_31append},
  {"insert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_34insert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_33insert},
  {"remove", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_36remove, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_35remove},
  {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_38set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_37set},
  {"add_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_40add_metadata, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_39add_metadata},
  {"with_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_42with_metadata, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_41with_metadata},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_44serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_43serialize},
  {"remove_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_46remove_metadata, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_45remove_metadata},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Schema[] = {
  {(char *)"pandas_metadata", __pyx_getprop_7pyarrow_3lib_6Schema_pandas_metadata, 0, (char *)"\n        Return deserialized-from-JSON pandas metadata field (if it exists)\n        ", 0},
  {(char *)"names", __pyx_getprop_7pyarrow_3lib_6Schema_names, 0, (char *)"\n        The schema's field names.\n\n        Returns\n        -------\n        list of str\n        ", 0},
  {(char *)"types", __pyx_getprop_7pyarrow_3lib_6Schema_types, 0, (char *)"\n        The schema's field types.\n\n        Returns\n        -------\n        list of DataType\n        ", 0},
  {(char *)"metadata", __pyx_getprop_7pyarrow_3lib_6Schema_metadata, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Schema = {
  __pyx_pw_7pyarrow_3lib_6Schema_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Schema, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Schema = {
  __pyx_pw_7pyarrow_3lib_6Schema_5__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_6Schema_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Schema = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Schema", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Schema, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Schema_50__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Schema, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Schema, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_6Schema_14__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_6Schema_48__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Schema()", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Schema, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_6Schema_9__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Schema, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Schema, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Schema_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Schema, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_Scalar(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Scalar *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Scalar *)o);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Scalar(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Scalar(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Scalar(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Scalar_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Scalar[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Scalar___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6Scalar_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Scalar[] = {
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_6Scalar_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    The base class for all array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Scalar, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Scalar, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_NAType(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NAType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NAType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NAType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NAType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_vtable_7pyarrow_3lib_ArrayValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ArrayValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  new((void*)&(p->sp_array)) std::shared_ptr< arrow::Array> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *p = (struct __pyx_obj_7pyarrow_3lib_ArrayValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_array);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ArrayValue(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_10ArrayValue_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 PyMethodDef __pyx_methods_7pyarrow_3lib_ArrayValue[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10ArrayValue_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10ArrayValue_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10ArrayValue_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10ArrayValue_12__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ArrayValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ArrayValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_9__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ArrayValue()\n\n    The base class for non-null array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ArrayValue, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ArrayValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ArrayValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_vtable_7pyarrow_3lib_ScalarValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ScalarValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  new((void*)&(p->sp_scalar)) std::shared_ptr< arrow::Scalar> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *p = (struct __pyx_obj_7pyarrow_3lib_ScalarValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_scalar);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ScalarValue(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_11ScalarValue_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 PyMethodDef __pyx_methods_7pyarrow_3lib_ScalarValue[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11ScalarValue_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11ScalarValue_12__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ScalarValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ScalarValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ScalarValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ScalarValue()\n\n    The base class for scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ScalarValue, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ScalarValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ScalarValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Value __pyx_vtable_7pyarrow_3lib_Int8Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int8Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int8Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9Int8Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9Int8Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_9Int8Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int8 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int8Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Value __pyx_vtable_7pyarrow_3lib_Int64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListValue __pyx_vtable_7pyarrow_3lib_ListValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_ListValue;
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ListValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_ListValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_type) {
    e = (*v)(((PyObject *)p->value_type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_ListValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_type);
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_ListValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9ListValue_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9ListValue_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_8as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListValue_7as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListValue_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_9ListValue_11__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListValue[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_9ListValue_value_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_ListValue = {
  __pyx_pw_7pyarrow_3lib_9ListValue_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_ListValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ListValue = {
  __pyx_pw_7pyarrow_3lib_9ListValue_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ListValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_ListValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ListValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for list array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_ListValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_ListValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_9ListValue_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue __pyx_vtable_7pyarrow_3lib_LargeListValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_LargeListValue;
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_LargeListValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p = (struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_LargeListValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p = (struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_type) {
    e = (*v)(((PyObject *)p->value_type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_LargeListValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p = (struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_type);
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_LargeListValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14LargeListValue_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14LargeListValue_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeListValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14LargeListValue_8as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14LargeListValue_7as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14LargeListValue_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14LargeListValue_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14LargeListValue_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14LargeListValue_11__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_LargeListValue[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_14LargeListValue_value_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_LargeListValue = {
  __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_LargeListValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LargeListValue = {
  __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_14LargeListValue_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeListValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeListValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_LargeListValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_LargeListValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LargeListValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for large list array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_LargeListValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_LargeListValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_14LargeListValue_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeListValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_LargeListValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeListValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructValue __pyx_vtable_7pyarrow_3lib_StructValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_StructValue;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_StructValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_3as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StructValue_2as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StructValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11StructValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StructValue = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_StructValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StructValue = {
  0, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StructValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StructValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for struct array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue __pyx_vtable_7pyarrow_3lib_UnionValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UnionValue;
  p->value_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_UnionValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_types);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_UnionValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_types) {
    e = (*v)(p->value_types, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_UnionValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_types);
  p->value_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UnionValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UnionValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10UnionValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_UnionValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for union array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_UnionValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_UnionValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringValue __pyx_vtable_7pyarrow_3lib_StringValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_StringValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11StringValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for string (utf8) array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryValue __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for fixed-size binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeBinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasConvertible(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__PandasConvertible[] = {
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_to_pandas},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__PandasConvertible = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._PandasConvertible", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__PandasConvertible, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__PandasConvertible, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_vtable_7pyarrow_3lib_Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Array *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Array;
  new((void*)&(p->sp_array)) std::shared_ptr< arrow::Array> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  p->_name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Array(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  __Pyx_call_destructor(p->sp_array);
  Py_CLEAR(p->type);
  Py_CLEAR(p->_name);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Array(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_Array)); if (e) return e;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  if (p->_name) {
    e = (*v)(p->_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Array(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_Array);
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_name);
  p->_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Array(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_5Array_3__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_5Array_3__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_3lib_5Array_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_10null_count_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_6offset_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array__name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_5_name_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Array[] = {
  {"_debug_print", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_5_debug_print, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_4_debug_print},
  {"diff", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_7diff, METH_O, __pyx_doc_7pyarrow_3lib_5Array_6diff},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_9cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_8cast},
  {"view", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_11view, METH_O, __pyx_doc_7pyarrow_3lib_5Array_10view},
  {"sum", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_13sum, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_12sum},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_15unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_14unique},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_17dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_16dictionary_encode},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_19from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_18from_pandas},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_21__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_20__reduce__},
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_23from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_22from_buffers},
  {"format", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_30format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_29format},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_34equals, METH_O, __pyx_doc_7pyarrow_3lib_5Array_33equals},
  {"isnull", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_38isnull, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_37isnull},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_42slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_41slice},
  {"take", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_44take, METH_O, __pyx_doc_7pyarrow_3lib_5Array_43take},
  {"filter", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_46filter, METH_O, __pyx_doc_7pyarrow_3lib_5Array_45filter},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_48_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_47_to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_50__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_49__array__},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_52to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_51to_numpy},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_54to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_53to_pylist},
  {"validate", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_56validate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_55validate},
  {"buffers", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_58buffers, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_57buffers},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Array[] = {
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_5Array_null_count, 0, (char *)0, 0},
  {(char *)"offset", __pyx_getprop_7pyarrow_3lib_5Array_offset, 0, (char *)"\n        A relative position into another array's data, to enable zero-copy\n        slicing. This value defaults to zero but must be applied on all\n        operations with the physical storage buffers.\n        ", 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_5Array_type, 0, (char *)0, 0},
  {(char *)"_name", __pyx_getprop_7pyarrow_3lib_5Array__name, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Array = {
  __pyx_pw_7pyarrow_3lib_5Array_36__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Array, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Array = {
  __pyx_pw_7pyarrow_3lib_5Array_36__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Array_40__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Array()\n\n    The base class for all Arrow arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Array, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Tensor __pyx_vtable_7pyarrow_3lib_Tensor;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Tensor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Tensor;
  new((void*)&(p->sp_tensor)) std::shared_ptr< arrow::Tensor> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Tensor(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_tensor);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Tensor(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Tensor(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Tensor(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Tensor_11__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_3lib_6Tensor_dim_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_9dim_names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_is_contiguous(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_13is_contiguous_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_7strides_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Tensor[] = {
  {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Tensor_4from_numpy},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_7to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Tensor_6to_numpy},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_9equals, METH_O, __pyx_doc_7pyarrow_3lib_6Tensor_8equals},
  {"dim_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_13dim_name, METH_O, __pyx_doc_7pyarrow_3lib_6Tensor_12dim_name},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_17__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Tensor_16__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_19__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6Tensor_18__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Tensor[] = {
  {(char *)"dim_names", __pyx_getprop_7pyarrow_3lib_6Tensor_dim_names, 0, (char *)0, 0},
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_6Tensor_is_mutable, 0, (char *)0, 0},
  {(char *)"is_contiguous", __pyx_getprop_7pyarrow_3lib_6Tensor_is_contiguous, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop_7pyarrow_3lib_6Tensor_ndim, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_6Tensor_size, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_6Tensor_shape, 0, (char *)0, 0},
  {(char *)"strides", __pyx_getprop_7pyarrow_3lib_6Tensor_strides, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_6Tensor_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyBufferProcs __pyx_tp_as_buffer_Tensor = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Tensor_15__getbuffer__, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Tensor = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Tensor", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Tensor, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Tensor_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*/
  &__pyx_tp_as_buffer_Tensor, /*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*/
  "Tensor()\n\n    A n-dimensional array a.k.a Tensor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Tensor, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Tensor, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Tensor, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Tensor, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Tensor, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Tensor_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Tensor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCSR __pyx_vtable_7pyarrow_3lib_SparseTensorCSR;

static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseTensorCSR(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_SparseTensorCSR;
  new((void*)&(p->sp_sparse_tensor)) std::shared_ptr< arrow::SparseTensorCSR> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SparseTensorCSR(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *p = (struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_sparse_tensor);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SparseTensorCSR(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *p = (struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SparseTensorCSR(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *p = (struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_SparseTensorCSR(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_15__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_15__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_3lib_15SparseTensorCSR_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_dim_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_9dim_names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_non_zero_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_15non_zero_length_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SparseTensorCSR[] = {
  {"from_dense_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_5from_dense_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_4from_dense_numpy},
  {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_6from_numpy},
  {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_9from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_8from_tensor},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_11to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_10to_numpy},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_13equals, METH_O, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_12equals},
  {"dim_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_17dim_name, METH_O, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_16dim_name},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_19__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_18__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCSR_21__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15SparseTensorCSR_20__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_SparseTensorCSR[] = {
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_is_mutable, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_ndim, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_shape, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_size, 0, (char *)0, 0},
  {(char *)"dim_names", __pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_dim_names, 0, (char *)0, 0},
  {(char *)"non_zero_length", __pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_non_zero_length, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_15SparseTensorCSR_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SparseTensorCSR = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SparseTensorCSR", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SparseTensorCSR, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SparseTensorCSR()\n\n    A sparse CSR tensor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SparseTensorCSR, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SparseTensorCSR, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_SparseTensorCSR, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SparseTensorCSR, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_SparseTensorCSR, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15SparseTensorCSR_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SparseTensorCSR, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseTensorCOO __pyx_vtable_7pyarrow_3lib_SparseTensorCOO;

static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseTensorCOO(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_SparseTensorCOO;
  new((void*)&(p->sp_sparse_tensor)) std::shared_ptr< arrow::SparseTensorCOO> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SparseTensorCOO(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *p = (struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_sparse_tensor);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SparseTensorCOO(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *p = (struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SparseTensorCOO(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *p = (struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_SparseTensorCOO(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_15__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_15__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_3lib_15SparseTensorCOO_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_dim_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_9dim_names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_non_zero_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_15non_zero_length_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SparseTensorCOO[] = {
  {"from_dense_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_5from_dense_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_4from_dense_numpy},
  {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_6from_numpy},
  {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_9from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_8from_tensor},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_11to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_10to_numpy},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_13equals, METH_O, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_12equals},
  {"dim_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_17dim_name, METH_O, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_16dim_name},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_19__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_18__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseTensorCOO_21__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15SparseTensorCOO_20__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_SparseTensorCOO[] = {
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_is_mutable, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_ndim, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_shape, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_size, 0, (char *)0, 0},
  {(char *)"dim_names", __pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_dim_names, 0, (char *)0, 0},
  {(char *)"non_zero_length", __pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_non_zero_length, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_15SparseTensorCOO_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SparseTensorCOO = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SparseTensorCOO", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SparseTensorCOO, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SparseTensorCOO()\n\n    A sparse COO tensor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SparseTensorCOO, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SparseTensorCOO, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_SparseTensorCOO, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SparseTensorCOO, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_SparseTensorCOO, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15SparseTensorCOO_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SparseTensorCOO, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NullArray __pyx_vtable_7pyarrow_3lib_NullArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NullArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NullArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NullArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_NullArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NullArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NullArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of null data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NullArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray __pyx_vtable_7pyarrow_3lib_BooleanArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BooleanArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BooleanArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_BooleanArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_BooleanArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BooleanArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of boolean data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BooleanArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_vtable_7pyarrow_3lib_NumericArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NumericArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NumericArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NumericArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NumericArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NumericArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow numeric arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NumericArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_vtable_7pyarrow_3lib_IntegerArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_IntegerArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_IntegerArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_IntegerArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.IntegerArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow integer arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_IntegerArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_vtable_7pyarrow_3lib_FloatingPointArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatingPointArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatingPointArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatingPointArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatingPointArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow floating-point arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatingPointArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array __pyx_vtable_7pyarrow_3lib_Int8Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int8Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int8 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array __pyx_vtable_7pyarrow_3lib_UInt8Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt8Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint8 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array __pyx_vtable_7pyarrow_3lib_Int16Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int16Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array __pyx_vtable_7pyarrow_3lib_UInt16Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt16Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array __pyx_vtable_7pyarrow_3lib_Int32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array __pyx_vtable_7pyarrow_3lib_UInt32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array __pyx_vtable_7pyarrow_3lib_Int64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array __pyx_vtable_7pyarrow_3lib_UInt64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray __pyx_vtable_7pyarrow_3lib_HalfFloatArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HalfFloatArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HalfFloatArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_HalfFloatArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_HalfFloatArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HalfFloatArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HalfFloatArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray __pyx_vtable_7pyarrow_3lib_FloatArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FloatArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray __pyx_vtable_7pyarrow_3lib_DoubleArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_DoubleArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a fixed-size binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array __pyx_vtable_7pyarrow_3lib_Decimal128Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Decimal128Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Decimal128Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Decimal128Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Decimal128Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Decimal128Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of decimal128 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Decimal128Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructArray __pyx_vtable_7pyarrow_3lib_StructArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_StructArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructArray[] = {
  {"field", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructArray_1field, METH_O, __pyx_doc_7pyarrow_3lib_11StructArray_field},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_3flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_2flatten},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_4from_arrays},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a struct data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListArray __pyx_vtable_7pyarrow_3lib_ListArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_ListArray;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9ListArray_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9ListArray_6values_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListArray[] = {
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_9ListArray_from_arrays},
  {"flatten", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListArray_3flatten, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListArray_2flatten},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListArray[] = {
  {(char *)"values", __pyx_getprop_7pyarrow_3lib_9ListArray_values, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a list data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray __pyx_vtable_7pyarrow_3lib_LargeListArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeListArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeListArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_LargeListArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeListArray[] = {
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14LargeListArray_from_arrays},
  {"flatten", (PyCFunction)__pyx_pw_7pyarrow_3lib_14LargeListArray_3flatten, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14LargeListArray_2flatten},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeListArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeListArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a large list data type\n    (like ListArray, but 64-bit offsets).\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeListArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeListArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray __pyx_vtable_7pyarrow_3lib_UnionArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UnionArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionArray[] = {
  {"from_dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_from_dense},
  {"from_sparse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_2from_sparse},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a Union data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringArray __pyx_vtable_7pyarrow_3lib_StringArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_StringArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringArray[] = {
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StringArray_from_buffers},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of string (or utf8) data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray __pyx_vtable_7pyarrow_3lib_BinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_BinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_BinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of variable-sized binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray __pyx_vtable_7pyarrow_3lib_DictionaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_DictionaryArray;
  p->_indices = Py_None; Py_INCREF(Py_None);
  p->_dictionary = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DictionaryArray(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_indices);
  Py_CLEAR(p->_dictionary);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Array(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_DictionaryArray(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Array(o, v, a); if (e) return e;
  if (p->_indices) {
    e = (*v)(p->_indices, a); if (e) return e;
  }
  if (p->_dictionary) {
    e = (*v)(p->_dictionary, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_DictionaryArray(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  __pyx_tp_clear_7pyarrow_3lib_Array(o);
  tmp = ((PyObject*)p->_indices);
  p->_indices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_dictionary);
  p->_dictionary = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryArray_dictionary(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryArray_10dictionary_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryArray_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryArray_7indices_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryArray[] = {
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryArray_1dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_dictionary_encode},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_2from_arrays},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryArray[] = {
  {(char *)"dictionary", __pyx_getprop_7pyarrow_3lib_15DictionaryArray_dictionary, 0, (char *)0, 0},
  {(char *)"indices", __pyx_getprop_7pyarrow_3lib_15DictionaryArray_indices, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DictionaryArray, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for dictionary-encoded Arrow arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_DictionaryArray, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_DictionaryArray, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray __pyx_vtable_7pyarrow_3lib_ExtensionArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ExtensionArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ExtensionArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_ExtensionArray;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14ExtensionArray_storage(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14ExtensionArray_7storage_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ExtensionArray[] = {
  {"from_storage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14ExtensionArray_from_storage},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ExtensionArray[] = {
  {(char *)"storage", __pyx_getprop_7pyarrow_3lib_14ExtensionArray_storage, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ExtensionArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ExtensionArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow extension arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ExtensionArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ExtensionArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ExtensionArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray __pyx_vtable_7pyarrow_3lib_ChunkedArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ChunkedArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ChunkedArray;
  new((void*)&(p->sp_chunked_array)) std::shared_ptr< arrow::ChunkedArray> ();
  p->_name = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_12ChunkedArray_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ChunkedArray(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p = (struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_chunked_array);
  Py_CLEAR(p->_name);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_ChunkedArray(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p = (struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_ChunkedArray)); if (e) return e;
  if (p->_name) {
    e = (*v)(p->_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_ChunkedArray(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p = (struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_ChunkedArray);
  tmp = ((PyObject*)p->_name);
  p->_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_ChunkedArray(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ChunkedArray(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_12ChunkedArray_24__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_12ChunkedArray_24__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_3lib_12ChunkedArray_data(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_4data_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_10null_count_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_num_chunks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_10num_chunks_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_chunks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_6chunks_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray__name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_5_name_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ChunkedArray[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_4__reduce__},
  {"length", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_7length, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_6length},
  {"format", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_13format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_12format},
  {"validate", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_17validate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_16validate},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_26equals, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_25equals},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_28_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_27_to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_30__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_29__array__},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_32cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_31cast},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_34dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_33dictionary_encode},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_36flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_35flatten},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_38unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_37unique},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_40slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_39slice},
  {"chunk", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_42chunk, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_41chunk},
  {"iterchunks", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_44iterchunks, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_43iterchunks},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_47to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_46to_pylist},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ChunkedArray[] = {
  {(char *)"data", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_data, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_type, 0, (char *)0, 0},
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_null_count, 0, (char *)"\n        Number of null entires\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"num_chunks", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_num_chunks, 0, (char *)"\n        Number of underlying chunks\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"chunks", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_chunks, 0, (char *)0, 0},
  {(char *)"_name", __pyx_getprop_7pyarrow_3lib_12ChunkedArray__name, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_ChunkedArray = {
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_ChunkedArray, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ChunkedArray = {
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_22__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ChunkedArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ChunkedArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ChunkedArray, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_11__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_ChunkedArray, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ChunkedArray, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_15__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ChunkedArray()\n\n    Array backed via one or more memory chunks.\n\n    Warning\n    -------\n    Do not call this class's constructor directly.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_ChunkedArray, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_ChunkedArray, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ChunkedArray, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_19__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ChunkedArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ChunkedArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ChunkedArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Table __pyx_vtable_7pyarrow_3lib_Table;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Table(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Table *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Table *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Table;
  new((void*)&(p->sp_table)) std::shared_ptr< arrow::Table> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_5Table_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Table(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Table *p = (struct __pyx_obj_7pyarrow_3lib_Table *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_table);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Table(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Table(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_5Table_21__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_5Table_21__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_3lib_5Table_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_7columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_11num_columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_column_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_12column_names_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Table[] = {
  {"validate", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_7validate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_6validate},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_9__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_8__reduce__},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_13slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_12slice},
  {"replace_schema_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_15replace_schema_metadata, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_14replace_schema_metadata},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_17flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_16flatten},
  {"combine_chunks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_19combine_chunks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_18combine_chunks},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_23equals, METH_O, __pyx_doc_7pyarrow_3lib_5Table_22equals},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_25cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_24cast},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_27from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_26from_pandas},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_29from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_28from_arrays},
  {"from_pydict", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_31from_pydict, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_30from_pydict},
  {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_33from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_32from_batches},
  {"to_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_35to_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_34to_batches},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_37_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_36_to_pandas},
  {"to_pydict", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_39to_pydict, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_38to_pydict},
  {"field", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_41field, METH_O, __pyx_doc_7pyarrow_3lib_5Table_40field},
  {"column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_43column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_42column},
  {"_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_45_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_44_column},
  {"itercolumns", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_47itercolumns, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_46itercolumns},
  {"add_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_52add_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_51add_column},
  {"append_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_54append_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_53append_column},
  {"remove_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_56remove_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_55remove_column},
  {"set_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_58set_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_57set_column},
  {"rename_columns", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_60rename_columns, METH_O, __pyx_doc_7pyarrow_3lib_5Table_59rename_columns},
  {"drop", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_62drop, METH_O, __pyx_doc_7pyarrow_3lib_5Table_61drop},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Table[] = {
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_5Table_schema, 0, (char *)"\n        Schema of the table and its columns\n\n        Returns\n        -------\n        pyarrow.Schema\n        ", 0},
  {(char *)"columns", __pyx_getprop_7pyarrow_3lib_5Table_columns, 0, (char *)"\n        List of all columns in numerical order\n\n        Returns\n        -------\n        list of pa.ChunkedArray\n        ", 0},
  {(char *)"num_columns", __pyx_getprop_7pyarrow_3lib_5Table_num_columns, 0, (char *)"\n        Number of columns in this table\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_5Table_num_rows, 0, (char *)"\n        Number of rows in this table.\n\n        Due to the definition of a table, all columns have the same number of\n        rows.\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_5Table_shape, 0, (char *)"\n        Dimensions of the table: (#rows, #columns)\n\n        Returns\n        -------\n        (int, int)\n        ", 0},
  {(char *)"column_names", __pyx_getprop_7pyarrow_3lib_5Table_column_names, 0, (char *)"\n        Names of the table's columns\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Table = {
  __pyx_pw_7pyarrow_3lib_5Table_50__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Table, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Table = {
  __pyx_pw_7pyarrow_3lib_5Table_50__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Table_11__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Table = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Table", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Table, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Table_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Table, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Table, /*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*/
  "Table()\n\n    A collection of top-level named, equal length Arrow arrays.\n\n    Warning\n    -------\n    Do not call this class's constructor directly, use one of the ``from_*``\n    methods instead.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Table, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Table, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Table, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Table_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Table, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch __pyx_vtable_7pyarrow_3lib_RecordBatch;

static PyObject *__pyx_tp_new_7pyarrow_3lib_RecordBatch(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_RecordBatch;
  new((void*)&(p->sp_batch)) std::shared_ptr< arrow::RecordBatch> ();
  p->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_11RecordBatch_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_RecordBatch(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_batch);
  Py_CLEAR(p->_schema);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_RecordBatch(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_RecordBatch)); if (e) return e;
  if (p->_schema) {
    e = (*v)(((PyObject *)p->_schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_RecordBatch(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_RecordBatch);
  tmp = ((PyObject*)p->_schema);
  p->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_RecordBatch(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_11num_columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_RecordBatch[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_4__reduce__},
  {"validate", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_9validate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_8validate},
  {"replace_schema_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_11replace_schema_metadata, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata},
  {"column", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_13column, METH_O, __pyx_doc_7pyarrow_3lib_11RecordBatch_12column},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_17serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_16serialize},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_19slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_18slice},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_21equals, METH_O, __pyx_doc_7pyarrow_3lib_11RecordBatch_20equals},
  {"to_pydict", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_23to_pydict, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_22to_pydict},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_25_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_24_to_pandas},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_27from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_26from_pandas},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_29from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_28from_arrays},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_RecordBatch[] = {
  {(char *)"num_columns", __pyx_getprop_7pyarrow_3lib_11RecordBatch_num_columns, 0, (char *)"\n        Number of columns\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_11RecordBatch_num_rows, 0, (char *)"\n        Number of rows\n\n        Due to the definition of a RecordBatch, all columns have the same\n        number of rows.\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_11RecordBatch_schema, 0, (char *)"\n        Schema of the RecordBatch and its columns\n\n        Returns\n        -------\n        pyarrow.Schema\n        ", 0},
  {(char *)"columns", __pyx_getprop_7pyarrow_3lib_11RecordBatch_columns, 0, (char *)"\n        List of all columns in numerical order\n\n        Returns\n        -------\n        list of pa.ChunkedArray\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_RecordBatch = {
  __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_RecordBatch, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_RecordBatch = {
  __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_11RecordBatch_15__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_RecordBatch = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.RecordBatch", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_RecordBatch, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_RecordBatch, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_RecordBatch, /*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*/
  "RecordBatch()\n\n    Batch of rows of columns of equal length\n\n    Warning\n    -------\n    Do not call this class's constructor directly, use one of the\n    ``RecordBatch.from_*`` functions instead.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_RecordBatch, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_RecordBatch, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_RecordBatch, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_RecordBatch, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_11RecordBatch_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_RecordBatch, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Buffer __pyx_vtable_7pyarrow_3lib_Buffer;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Buffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Buffer;
  new((void*)&(p->buffer)) std::shared_ptr< arrow::Buffer> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_6Buffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Buffer(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *p = (struct __pyx_obj_7pyarrow_3lib_Buffer *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->buffer);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Buffer(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Buffer(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Buffer_15__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Buffer_15__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_3lib_6Buffer_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Buffer_address(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Buffer_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Buffer_parent(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_6parent_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Buffer[] = {
  {"hex", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_7hex, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Buffer_6hex},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Buffer_11slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Buffer_10slice},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_13equals, METH_O, __pyx_doc_7pyarrow_3lib_6Buffer_12equals},
  {"__reduce_ex__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_17__reduce_ex__, METH_O, __pyx_doc_7pyarrow_3lib_6Buffer_16__reduce_ex__},
  {"to_pybytes", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_19to_pybytes, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Buffer_18to_pybytes},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Buffer[] = {
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_6Buffer_size, 0, (char *)"\n        The buffer size in bytes.\n        ", 0},
  {(char *)"address", __pyx_getprop_7pyarrow_3lib_6Buffer_address, 0, (char *)"\n        The buffer's address, as an integer.\n        ", 0},
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_6Buffer_is_mutable, 0, (char *)"\n        Whether the buffer is mutable.\n        ", 0},
  {(char *)"parent", __pyx_getprop_7pyarrow_3lib_6Buffer_parent, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Buffer = {
  __pyx_pw_7pyarrow_3lib_6Buffer_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Buffer, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Buffer = {
  __pyx_pw_7pyarrow_3lib_6Buffer_5__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_6Buffer_9__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Buffer = {
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_25__getreadbuffer__, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_27__getwritebuffer__, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_23__getsegcount__, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Buffer_21__getbuffer__, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Buffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Buffer", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Buffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Buffer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Buffer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Buffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Buffer()\n\n    The base class for all Arrow buffers.\n\n    A buffer represents a contiguous memory area.  Many buffers will own\n    their memory, though not all of them do.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Buffer, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Buffer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Buffer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Buffer_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Buffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer __pyx_vtable_7pyarrow_3lib_ResizableBuffer;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ResizableBuffer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Buffer(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Buffer*)__pyx_vtabptr_7pyarrow_3lib_ResizableBuffer;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ResizableBuffer[] = {
  {"resize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15ResizableBuffer_resize},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ResizableBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ResizableBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Buffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    A base class for buffers that can be resized.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ResizableBuffer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_6Buffer_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ResizableBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_vtable_7pyarrow_3lib_NativeFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NativeFile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_NativeFile;
  new((void*)&(p->input_stream)) std::shared_ptr<arrow::io::InputStream> ();
  new((void*)&(p->random_access)) std::shared_ptr<arrow::io::RandomAccessFile> ();
  new((void*)&(p->output_stream)) std::shared_ptr<arrow::io::OutputStream> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *p = (struct __pyx_obj_7pyarrow_3lib_NativeFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  __Pyx_call_destructor(p->input_stream);
  __Pyx_call_destructor(p->random_access);
  __Pyx_call_destructor(p->output_stream);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10NativeFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10NativeFile_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10NativeFile_closed(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(self);}

static PyMethodDef __pyx_methods_7pyarrow_3lib_NativeFile[] = {
  {"__enter__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_5__enter__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_4__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_6__exit__},
  {"readable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_9readable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_8readable},
  {"writable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_11writable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_10writable},
  {"seekable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_12seekable},
  {"isatty", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_14isatty},
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_17fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_16fileno},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_19close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_18close},
  {"_assert_open", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_21_assert_open, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_20_assert_open},
  {"_assert_readable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_readable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_22_assert_readable},
  {"_assert_writable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_25_assert_writable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_24_assert_writable},
  {"_assert_seekable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_27_assert_seekable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_26_assert_seekable},
  {"size", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_29size, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_28size},
  {"tell", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_31tell, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_30tell},
  {"seek", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_33seek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_32seek},
  {"flush", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_35flush, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_34flush},
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_37write, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_36write},
  {"read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_39read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_38read},
  {"read_at", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_41read_at, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_40read_at},
  {"read1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_43read1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_42read1},
  {"readall", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_45readall, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_44readall},
  {"readinto", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_47readinto, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_46readinto},
  {"readline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_49readline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_48readline},
  {"readlines", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_51readlines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_50readlines},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, METH_NOARGS|METH_COEXIST, 0},
  {"read_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_57read_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_56read_buffer},
  {"truncate", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_59truncate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_58truncate},
  {"writelines", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_61writelines, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_60writelines},
  {"download", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_63download, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_62download},
  {"upload", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_65upload, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_64upload},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_67__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_66__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_69__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_68__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_NativeFile[] = {
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_10NativeFile_mode, 0, (char *)"\n        The file mode. Currently instances of NativeFile may support:\n\n        * rb: binary read\n        * wb: binary write\n        * rb+: binary read and write\n        ", 0},
  {(char *)"closed", __pyx_getprop_7pyarrow_3lib_10NativeFile_closed, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_NativeFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NativeFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    The base class for all Arrow streams.\n\n    Streams are either readable, writable, or both.\n    They optionally support seeking.\n\n    While this class exposes methods to read or write data from Python, the\n    primary intent of using a Arrow stream is to pass it to other Arrow\n    facilities that will make use of it, such as Arrow IPC routines.\n\n    Be aware that there are subtle differences with regular Python files,\n    e.g. destroying a writable Arrow stream without closing it explicitly\n    will not flush any pending data.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_NativeFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_NativeFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NativeFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream __pyx_vtable_7pyarrow_3lib_BufferedInputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedInputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferedInputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferedInputStream[] = {
  {"detach", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3detach, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_2detach},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferedInputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferedInputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "BufferedInputStream(NativeFile stream, int buffer_size, MemoryPool memory_pool=None)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferedInputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferedInputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream __pyx_vtable_7pyarrow_3lib_BufferedOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferedOutputStream[] = {
  {"detach", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3detach, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_2detach},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferedOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferedOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "BufferedOutputStream(NativeFile stream, int buffer_size, MemoryPool memory_pool=None)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferedOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferedOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream __pyx_vtable_7pyarrow_3lib_CompressedInputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedInputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_CompressedInputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_CompressedInputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_CompressedInputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.CompressedInputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "CompressedInputStream(NativeFile stream, compression)\n\n    An input stream wrapper which decompresses data on the fly.\n\n    Parameters\n    ----------\n    stream : pa.NativeFile\n    compression : str\n        The compression type (\"bz2\", \"brotli\", \"gzip\", \"lz4\" or \"zstd\")\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_CompressedInputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_CompressedInputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream __pyx_vtable_7pyarrow_3lib_CompressedOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_CompressedOutputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_CompressedOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.CompressedOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "CompressedOutputStream(NativeFile stream, compression)\n\n    An output stream wrapper which compresses data on the fly.\n\n    Parameters\n    ----------\n    stream : pa.NativeFile\n    compression : str\n        The compression type (\"bz2\", \"brotli\", \"gzip\", \"lz4\" or \"zstd\")\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_CompressedOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_CompressedOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)o);
  new((void*)&(p->writer)) std::shared_ptr< arrow::ipc::RecordBatchWriter> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *p = (struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->writer);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__CRecordBatchWriter[] = {
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_write},
  {"write_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch},
  {"write_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_4write_table},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_6close},
  {"__enter__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__CRecordBatchWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._CRecordBatchWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "The base RecordBatchWriter wrapper.\n\n    Provides common implementations of convenience methods. Should not\n    be instantiated directly by user code.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__CRecordBatchWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)o);
  new((void*)&(p->reader)) std::shared_ptr< arrow::RecordBatchReader> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *p = (struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__CRecordBatchReader[] = {
  {"get_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch},
  {"read_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch},
  {"read_all", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_7read_all},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__CRecordBatchReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._CRecordBatchReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "The base RecordBatchReader wrapper.\n\n    Provides common implementations of convenience methods. Should not\n    be instantiated directly by user code.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__CRecordBatchReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__CRecordBatchReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim __pyx_vtable_7pyarrow_3lib__PandasAPIShim;

static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasAPIShim(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim;
  p->_loose_version = Py_None; Py_INCREF(Py_None);
  p->_version = Py_None; Py_INCREF(Py_None);
  p->_pd = Py_None; Py_INCREF(Py_None);
  p->_types_api = Py_None; Py_INCREF(Py_None);
  p->_compat_module = Py_None; Py_INCREF(Py_None);
  p->_data_frame = Py_None; Py_INCREF(Py_None);
  p->_index = Py_None; Py_INCREF(Py_None);
  p->_series = Py_None; Py_INCREF(Py_None);
  p->_categorical_type = Py_None; Py_INCREF(Py_None);
  p->_datetimetz_type = Py_None; Py_INCREF(Py_None);
  p->_extension_array = Py_None; Py_INCREF(Py_None);
  p->_array_like_types = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__PandasAPIShim(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_loose_version);
  Py_CLEAR(p->_version);
  Py_CLEAR(p->_pd);
  Py_CLEAR(p->_types_api);
  Py_CLEAR(p->_compat_module);
  Py_CLEAR(p->_data_frame);
  Py_CLEAR(p->_index);
  Py_CLEAR(p->_series);
  Py_CLEAR(p->_categorical_type);
  Py_CLEAR(p->_datetimetz_type);
  Py_CLEAR(p->_extension_array);
  Py_CLEAR(p->_array_like_types);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__PandasAPIShim(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  if (p->_loose_version) {
    e = (*v)(p->_loose_version, a); if (e) return e;
  }
  if (p->_version) {
    e = (*v)(p->_version, a); if (e) return e;
  }
  if (p->_pd) {
    e = (*v)(p->_pd, a); if (e) return e;
  }
  if (p->_types_api) {
    e = (*v)(p->_types_api, a); if (e) return e;
  }
  if (p->_compat_module) {
    e = (*v)(p->_compat_module, a); if (e) return e;
  }
  if (p->_data_frame) {
    e = (*v)(p->_data_frame, a); if (e) return e;
  }
  if (p->_index) {
    e = (*v)(p->_index, a); if (e) return e;
  }
  if (p->_series) {
    e = (*v)(p->_series, a); if (e) return e;
  }
  if (p->_categorical_type) {
    e = (*v)(p->_categorical_type, a); if (e) return e;
  }
  if (p->_datetimetz_type) {
    e = (*v)(p->_datetimetz_type, a); if (e) return e;
  }
  if (p->_extension_array) {
    e = (*v)(p->_extension_array, a); if (e) return e;
  }
  if (p->_array_like_types) {
    e = (*v)(p->_array_like_types, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__PandasAPIShim(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  tmp = ((PyObject*)p->_loose_version);
  p->_loose_version = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_version);
  p->_version = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pd);
  p->_pd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_types_api);
  p->_types_api = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_compat_module);
  p->_compat_module = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_data_frame);
  p->_data_frame = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_index);
  p->_index = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_series);
  p->_series = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_categorical_type);
  p->_categorical_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_datetimetz_type);
  p->_datetimetz_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_extension_array);
  p->_extension_array = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_like_types);
  p->_array_like_types = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_have_pandas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11have_pandas_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_compat(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6compat_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_pd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_2pd_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_loose_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13loose_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_categorical_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16categorical_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_datetimetz_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__loose_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_loose_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_8_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3_pd_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__types_api(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10_types_api_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__compat_module(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_compat_module_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__data_frame(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11_data_frame_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__index(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_index_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__series(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7_series_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__categorical_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__datetimetz_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__extension_array(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_array_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__array_like_types(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_has_sparse(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10has_sparse_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__PandasAPIShim[] = {
  {"series", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3series, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_2series},
  {"data_frame", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_5data_frame, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_4data_frame},
  {"infer_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype},
  {"is_array_like", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_8is_array_like},
  {"is_categorical", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_10is_categorical},
  {"is_datetimetz", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz},
  {"is_sparse", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_sparse, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_14is_sparse},
  {"is_data_frame", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_data_frame, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_16is_data_frame},
  {"is_series", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_series, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_18is_series},
  {"assert_frame_equal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21assert_frame_equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_20assert_frame_equal},
  {"get_rangeindex_attribute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23get_rangeindex_attribute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_22get_rangeindex_attribute},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_24__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_27__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_26__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__PandasAPIShim[] = {
  {(char *)"have_pandas", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_have_pandas, 0, (char *)0, 0},
  {(char *)"compat", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_compat, 0, (char *)0, 0},
  {(char *)"pd", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_pd, 0, (char *)0, 0},
  {(char *)"loose_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_loose_version, 0, (char *)0, 0},
  {(char *)"version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_version, 0, (char *)0, 0},
  {(char *)"categorical_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_categorical_type, 0, (char *)0, 0},
  {(char *)"datetimetz_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_datetimetz_type, 0, (char *)0, 0},
  {(char *)"_loose_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__loose_version, 0, (char *)0, 0},
  {(char *)"_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__version, 0, (char *)0, 0},
  {(char *)"_pd", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd, 0, (char *)0, 0},
  {(char *)"_types_api", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__types_api, 0, (char *)0, 0},
  {(char *)"_compat_module", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__compat_module, 0, (char *)0, 0},
  {(char *)"_data_frame", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__data_frame, 0, (char *)0, 0},
  {(char *)"_index", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__index, 0, (char *)0, 0},
  {(char *)"_series", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__series, 0, (char *)0, 0},
  {(char *)"_categorical_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__categorical_type, 0, (char *)0, 0},
  {(char *)"_datetimetz_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__datetimetz_type, 0, (char *)0, 0},
  {(char *)"_extension_array", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__extension_array, 0, (char *)0, 0},
  {(char *)"_array_like_types", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__array_like_types, 0, (char *)0, 0},
  {(char *)"has_sparse", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_has_sparse, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__PandasAPIShim = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._PandasAPIShim", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__PandasAPIShim, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_PandasAPIShim()\n\n    Lazy pandas importer that isolates usages of pandas APIs and avoids\n    importing pandas until it's actually needed\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__PandasAPIShim, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__PandasAPIShim, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__PandasAPIShim, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__PandasAPIShim, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__PandasAPIShim, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool __pyx_vtable_7pyarrow_3lib_LoggingMemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_MemoryPool(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool;
  new((void*)&(p->logging_pool)) std::unique_ptr< arrow::LoggingMemoryPool> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_LoggingMemoryPool(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *p = (struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->logging_pool);
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LoggingMemoryPool[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LoggingMemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LoggingMemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_LoggingMemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "LoggingMemoryPool()", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LoggingMemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool __pyx_vtable_7pyarrow_3lib_ProxyMemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_MemoryPool(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool;
  new((void*)&(p->proxy_pool)) std::unique_ptr< arrow::ProxyMemoryPool> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ProxyMemoryPool(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *p = (struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->proxy_pool);
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ProxyMemoryPool[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ProxyMemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ProxyMemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ProxyMemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "ProxyMemoryPool()\n\n    Memory pool implementation that tracks the number of bytes and\n    maximum memory allocated through its direct calls, while redirecting\n    to another memory pool.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ProxyMemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionType __pyx_vtable_7pyarrow_3lib_UnionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_UnionType;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_UnionType(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9UnionType_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9UnionType_type_codes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9UnionType_8__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9UnionType_7__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_UnionType[] = {
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_9UnionType_mode, 0, (char *)"\n        The mode of the union (\"dense\" or \"sparse\").\n        ", 0},
  {(char *)"type_codes", __pyx_getprop_7pyarrow_3lib_9UnionType_type_codes, 0, (char *)"\n        The type code to indicate each data type in this union.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_UnionType = {
  __pyx_pw_7pyarrow_3lib_9UnionType_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_UnionType, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_UnionType = {
  __pyx_pw_7pyarrow_3lib_9UnionType_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_UnionType, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_UnionType, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for struct data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_9UnionType_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_UnionType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnknownExtensionType __pyx_vtable_7pyarrow_3lib_UnknownExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnknownExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_PyExtensionType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType;
  p->serialized = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_UnknownExtensionType(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *p = (struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  Py_CLEAR(p->serialized);
  __pyx_tp_dealloc_7pyarrow_3lib_DataType(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnknownExtensionType[] = {
  {"__arrow_ext_serialize__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20UnknownExtensionType_3__arrow_ext_serialize__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnknownExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnknownExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_UnknownExtensionType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "UnknownExtensionType(DataType storage_type, serialized)\n\n    A concrete class for Python-defined extension types that refer to\n    an unknown Python implementation.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnknownExtensionType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20UnknownExtensionType_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnknownExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__ExtensionRegistryNanny(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)o);
  new((void*)&(p->registry)) std::shared_ptr< arrow::ExtensionTypeRegistry> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__ExtensionRegistryNanny(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *p = (struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->registry);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__ExtensionRegistryNanny[] = {
  {"release_registry", (PyCFunction)__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_3release_registry, METH_NOARGS, __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._ExtensionRegistryNanny", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__ExtensionRegistryNanny, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__ExtensionRegistryNanny, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__ExtensionRegistryNanny, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_NullType(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_7pyarrow_3lib_8NullType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_NullType(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_8NullType_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_8NullType_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 PyMethodDef __pyx_methods_7pyarrow_3lib_NullType[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_8NullType_5as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8NullType_4as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8NullType_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8NullType_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8NullType_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_8NullType_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_NullType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NullType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_8NullType_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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Singleton for null array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_NullType, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_NullType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NullType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanValue __pyx_vtable_7pyarrow_3lib_BooleanValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BooleanValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_BooleanValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BooleanValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BooleanValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BooleanValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12BooleanValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BooleanValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BooleanValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for boolean array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_BooleanValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BooleanValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Value __pyx_vtable_7pyarrow_3lib_UInt8Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt8Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt8Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UInt8Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UInt8Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10UInt8Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint8 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt8Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Value __pyx_vtable_7pyarrow_3lib_Int16Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int16Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int16Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int16Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int16Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int16Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int16Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Value __pyx_vtable_7pyarrow_3lib_UInt16Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt16Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt16Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt16Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt16Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt16Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt16Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Value __pyx_vtable_7pyarrow_3lib_Int32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Value __pyx_vtable_7pyarrow_3lib_UInt32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Value __pyx_vtable_7pyarrow_3lib_UInt64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Value __pyx_vtable_7pyarrow_3lib_Date32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Date32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Date32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Date32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Date32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for date32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Date32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Value __pyx_vtable_7pyarrow_3lib_Date64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Date64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Date64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Date64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Date64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for date64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Date64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Value __pyx_vtable_7pyarrow_3lib_Time32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Time32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Time32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Time32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for time32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Time32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Value __pyx_vtable_7pyarrow_3lib_Time64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Time64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Time64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Time64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for time64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Time64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampValue __pyx_vtable_7pyarrow_3lib_TimestampValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_TimestampValue;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14TimestampValue_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14TimestampValue_5value_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_TimestampValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14TimestampValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14TimestampValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14TimestampValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_TimestampValue[] = {
  {(char *)"value", __pyx_getprop_7pyarrow_3lib_14TimestampValue_value, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for timestamp array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_TimestampValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_TimestampValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatValue __pyx_vtable_7pyarrow_3lib_HalfFloatValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_HalfFloatValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HalfFloatValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HalfFloatValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HalfFloatValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_HalfFloatValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HalfFloatValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatValue __pyx_vtable_7pyarrow_3lib_FloatValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_FloatValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FloatValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10FloatValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10FloatValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10FloatValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FloatValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleValue __pyx_vtable_7pyarrow_3lib_DoubleValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DoubleValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DoubleValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11DoubleValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11DoubleValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11DoubleValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DoubleValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DecimalValue __pyx_vtable_7pyarrow_3lib_DecimalValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DecimalValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DecimalValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DecimalValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DecimalValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DecimalValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DecimalValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12DecimalValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DecimalValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DecimalValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DecimalValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for decimal128 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DecimalValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DecimalValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringValue __pyx_vtable_7pyarrow_3lib_LargeStringValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeStringValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_LargeStringValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeStringValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeStringValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeStringValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeStringValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeStringValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeStringValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for large string (utf8) array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeStringValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeStringValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryValue __pyx_vtable_7pyarrow_3lib_BinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_BinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11BinaryValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for variable-sized binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_BinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryValue __pyx_vtable_7pyarrow_3lib_LargeBinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeBinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeBinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeBinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for large variable-sized binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeBinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeBinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryValue __pyx_vtable_7pyarrow_3lib_DictionaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DictionaryValue;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryValue_index_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryValue_dictionary_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryValue[] = {
  {(char *)"index_value", __pyx_getprop_7pyarrow_3lib_15DictionaryValue_index_value, 0, (char *)"\n        Return this value's underlying index as a ArrayValue of the right\n        signed integer type.\n        ", 0},
  {(char *)"dictionary_value", __pyx_getprop_7pyarrow_3lib_15DictionaryValue_dictionary_value, 0, (char *)"\n        Return this value's underlying dictionary value as a ArrayValue.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for dictionary-encoded array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Scalar __pyx_vtable_7pyarrow_3lib_UInt8Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt8Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt8Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint8 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt8Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Scalar __pyx_vtable_7pyarrow_3lib_Int8Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int8Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int8Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int8Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int8 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int8Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Scalar __pyx_vtable_7pyarrow_3lib_UInt16Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt16Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt16Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint16 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt16Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Scalar __pyx_vtable_7pyarrow_3lib_Int16Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int16Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int16Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int16Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int16 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int16Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Scalar __pyx_vtable_7pyarrow_3lib_UInt32Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt32Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt32Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint32 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt32Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Scalar __pyx_vtable_7pyarrow_3lib_Int32Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int32Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int32Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int32Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int32 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int32Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Scalar __pyx_vtable_7pyarrow_3lib_UInt64Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt64Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt64Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint64 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt64Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Scalar __pyx_vtable_7pyarrow_3lib_Int64Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int64Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int64Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int64Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int64 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int64Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatScalar __pyx_vtable_7pyarrow_3lib_FloatScalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatScalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatScalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_FloatScalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FloatScalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11FloatScalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11FloatScalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11FloatScalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatScalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatScalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatScalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FloatScalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatScalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleScalar __pyx_vtable_7pyarrow_3lib_DoubleScalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleScalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleScalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_DoubleScalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DoubleScalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DoubleScalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleScalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleScalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleScalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for double scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DoubleScalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleScalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__FunctionContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__FunctionContext *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)o);
  new((void*)&(p->ctx)) std::unique_ptr< arrow::compute::FunctionContext> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_16_FunctionContext_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__FunctionContext(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__FunctionContext *p = (struct __pyx_obj_7pyarrow_3lib__FunctionContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->ctx);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__FunctionContext[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16_FunctionContext_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16_FunctionContext_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__FunctionContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._FunctionContext", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__FunctionContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__FunctionContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__FunctionContext, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__FunctionContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Array __pyx_vtable_7pyarrow_3lib_Date32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Date32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Date32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of date32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Array __pyx_vtable_7pyarrow_3lib_Date64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Date64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Date64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of date64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampArray __pyx_vtable_7pyarrow_3lib_TimestampArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_TimestampArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of timestamp data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Array __pyx_vtable_7pyarrow_3lib_Time32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Time32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of time32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Array __pyx_vtable_7pyarrow_3lib_Time64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Time64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of time64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringArray __pyx_vtable_7pyarrow_3lib_LargeStringArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeStringArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeStringArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_LargeStringArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeStringArray[] = {
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16LargeStringArray_from_buffers},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeStringArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeStringArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeStringArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of large string (or utf8) data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeStringArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeStringArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryArray __pyx_vtable_7pyarrow_3lib_LargeBinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeBinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeBinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_28__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_32__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of large variable-sized binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_25__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeBinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringBuilder(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringBuilder *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)o);
  new((void*)&(p->builder)) std::unique_ptr< arrow::StringBuilder> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13StringBuilder_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_StringBuilder(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_StringBuilder *p = (struct __pyx_obj_7pyarrow_3lib_StringBuilder *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->builder);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13StringBuilder_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13StringBuilder_10null_count_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringBuilder[] = {
  {"append", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_3append, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_2append},
  {"append_values", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_5append_values, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_4append_values},
  {"finish", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_7finish, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13StringBuilder_6finish},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13StringBuilder_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_StringBuilder[] = {
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_13StringBuilder_null_count, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StringBuilder = {
  __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StringBuilder = {
  __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringBuilder = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringBuilder", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringBuilder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_StringBuilder, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StringBuilder, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StringBuilder, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Builder class for UTF8 strings. This class exposes facilities for\n    incrementally adding string values and building the null bitmap\n    for a pyarrow.Array (type='string').\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringBuilder, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_StringBuilder, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringBuilder, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile __pyx_vtable_7pyarrow_3lib_PythonFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_PythonFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_PythonFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_PythonFile;
  p->handle = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_10PythonFile_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_PythonFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->handle);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_PythonFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_PythonFile)); if (e) return e;
  if (p->handle) {
    e = (*v)(p->handle, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_PythonFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_PythonFile);
  tmp = ((PyObject*)p->handle);
  p->handle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_PythonFile[] = {
  {"truncate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_2truncate},
  {"readline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_5readline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_4readline},
  {"readlines", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_7readlines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_6readlines},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10PythonFile_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10PythonFile_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10PythonFile_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10PythonFile_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_PythonFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.PythonFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_PythonFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_PythonFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream backed by a Python file object.\n\n    This class allows using Python file objects with arbitrary Arrow\n    functions, including functions written in another language than Python.\n\n    As a downside, there is a non-zero redirection cost in translating\n    Arrow stream calls to Python method calls.  Furthermore, Python's\n    Global Interpreter Lock may limit parallelism in some situations.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_PythonFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_PythonFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_PythonFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_PythonFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile __pyx_vtable_7pyarrow_3lib_MemoryMappedFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryMappedFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile;
  new((void*)&(p->handle)) std::shared_ptr< arrow::io::MemoryMappedFile> ();
  p->path = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MemoryMappedFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->handle);
  Py_CLEAR(p->path);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile)); if (e) return e;
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile);
  tmp = ((PyObject*)p->path);
  p->path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MemoryMappedFile[] = {
  {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_create},
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_2_open},
  {"resize", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize, METH_O, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_4resize},
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_7fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_6fileno},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MemoryMappedFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MemoryMappedFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryMappedFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream that represents a memory-mapped file.\n\n    Supports 'r', 'r+', 'w' modes.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_MemoryMappedFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MemoryMappedFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_OSFile __pyx_vtable_7pyarrow_3lib_OSFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_OSFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_OSFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_OSFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_OSFile;
  p->path = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_OSFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->path);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_OSFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_OSFile)); if (e) return e;
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_OSFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_OSFile);
  tmp = ((PyObject*)p->path);
  p->path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_OSFile[] = {
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_3fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6OSFile_2fileno},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6OSFile_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6OSFile_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_OSFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.OSFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_OSFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_OSFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream backed by a regular file descriptor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_OSFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_OSFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_OSFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_OSFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBufferWriter __pyx_vtable_7pyarrow_3lib_FixedSizeBufferWriter;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter;
  if (unlikely(__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBufferWriter[] = {
  {"set_memcopy_threads", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads},
  {"set_memcopy_blocksize", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize},
  {"set_memcopy_threshold", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBufferWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    A stream writing to a Arrow buffer.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_FixedSizeBufferWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream __pyx_vtable_7pyarrow_3lib_BufferOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferOutputStream;
  new((void*)&(p->buffer)) std::shared_ptr< arrow::ResizableBuffer> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_BufferOutputStream(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *p = (struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->buffer);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferOutputStream[] = {
  {"getvalue", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_2getvalue},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_BufferOutputStream, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MockOutputStream __pyx_vtable_7pyarrow_3lib_MockOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MockOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MockOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_MockOutputStream;
  if (unlikely(__pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MockOutputStream[] = {
  {"size", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MockOutputStream_2size},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MockOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MockOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MockOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_MockOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MockOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader __pyx_vtable_7pyarrow_3lib_BufferReader;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferReader *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferReader;
  p->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_12BufferReader_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_BufferReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->buffer);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_BufferReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_BufferReader)); if (e) return e;
  if (p->buffer) {
    e = (*v)(((PyObject *)p->buffer), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_BufferReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_BufferReader);
  tmp = ((PyObject*)p->buffer);
  p->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferReader[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BufferReader_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BufferReader_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12BufferReader_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_BufferReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Zero-copy reader from objects convertible to Arrow buffer\n\n    Parameters\n    ----------\n    obj : Python bytes or pyarrow.Buffer\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_BufferReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_BufferReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem __pyx_vtable_7pyarrow_3lib_HadoopFileSystem;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HadoopFileSystem(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem;
  new((void*)&(p->client)) std::shared_ptr< arrow::io::HadoopFileSystem> ();
  p->host = Py_None; Py_INCREF(Py_None);
  p->user = Py_None; Py_INCREF(Py_None);
  p->kerb_ticket = Py_None; Py_INCREF(Py_None);
  p->driver = Py_None; Py_INCREF(Py_None);
  p->extra_conf = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_HadoopFileSystem(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->client);
  Py_CLEAR(p->host);
  Py_CLEAR(p->user);
  Py_CLEAR(p->kerb_ticket);
  Py_CLEAR(p->driver);
  Py_CLEAR(p->extra_conf);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_HadoopFileSystem(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  if (p->host) {
    e = (*v)(p->host, a); if (e) return e;
  }
  if (p->user) {
    e = (*v)(p->user, a); if (e) return e;
  }
  if (p->kerb_ticket) {
    e = (*v)(p->kerb_ticket, a); if (e) return e;
  }
  if (p->driver) {
    e = (*v)(p->driver, a); if (e) return e;
  }
  if (p->extra_conf) {
    e = (*v)(p->extra_conf, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_HadoopFileSystem(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  tmp = ((PyObject*)p->host);
  p->host = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->user);
  p->user = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->kerb_ticket);
  p->kerb_ticket = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->driver);
  p->driver = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->extra_conf);
  p->extra_conf = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_is_open(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_host(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_user(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_kerb_ticket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_driver(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_port(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_extra_conf(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HadoopFileSystem[] = {
  {"_connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem__connect},
  {"connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_2connect},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_6close},
  {"exists", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_8exists},
  {"isdir", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_10isdir},
  {"isfile", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_12isfile},
  {"get_capacity", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_14get_capacity},
  {"get_space_used", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_16get_space_used},
  {"df", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_18df},
  {"rename", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_20rename},
  {"info", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_22info},
  {"stat", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_24stat},
  {"ls", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_26ls},
  {"chmod", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_28chmod},
  {"chown", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_30chown},
  {"mkdir", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_32mkdir},
  {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_34delete},
  {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_36open},
  {"download", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_38download},
  {"upload", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_40upload},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_45__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_HadoopFileSystem[] = {
  {(char *)"is_open", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_is_open, 0, (char *)0, 0},
  {(char *)"host", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_host, 0, (char *)0, 0},
  {(char *)"user", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_user, 0, (char *)0, 0},
  {(char *)"kerb_ticket", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_kerb_ticket, 0, (char *)0, 0},
  {(char *)"driver", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_driver, 0, (char *)0, 0},
  {(char *)"port", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_port, 0, (char *)0, 0},
  {(char *)"extra_conf", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_extra_conf, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HadoopFileSystem = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HadoopFileSystem", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_HadoopFileSystem, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_HadoopFileSystem, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_HadoopFileSystem, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_HadoopFileSystem, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_HadoopFileSystem, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HadoopFileSystem, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__HdfsFileNanny(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o);
  p->client = Py_None; Py_INCREF(Py_None);
  p->file_handle_ref = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__HdfsFileNanny(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->client);
  Py_CLEAR(p->file_handle_ref);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__HdfsFileNanny(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  if (p->client) {
    e = (*v)(p->client, a); if (e) return e;
  }
  if (p->file_handle_ref) {
    e = (*v)(p->file_handle_ref, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__HdfsFileNanny(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  tmp = ((PyObject*)p->client);
  p->client = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->file_handle_ref);
  p->file_handle_ref = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__HdfsFileNanny[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__HdfsFileNanny = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._HdfsFileNanny", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__HdfsFileNanny, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__HdfsFileNanny, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__HdfsFileNanny, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__HdfsFileNanny, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__HdfsFileNanny, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile __pyx_vtable_7pyarrow_3lib_HdfsFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HdfsFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_HdfsFile;
  p->mode = Py_None; Py_INCREF(Py_None);
  p->parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_HdfsFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->parent);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_HdfsFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_HdfsFile)); if (e) return e;
  if (p->mode) {
    e = (*v)(p->mode, a); if (e) return e;
  }
  if (p->parent) {
    e = (*v)(p->parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_HdfsFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_HdfsFile);
  tmp = ((PyObject*)p->mode);
  p->mode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->parent);
  p->parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_buffer_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_parent(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HdfsFile[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8HdfsFile_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8HdfsFile_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_8HdfsFile_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_HdfsFile[] = {
  {(char *)"buffer_size", __pyx_getprop_7pyarrow_3lib_8HdfsFile_buffer_size, 0, (char *)0, 0},
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_8HdfsFile_mode, 0, (char *)0, 0},
  {(char *)"parent", __pyx_getprop_7pyarrow_3lib_8HdfsFile_parent, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HdfsFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HdfsFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HdfsFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_HdfsFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_HdfsFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_HdfsFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_HdfsFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_HdfsFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HdfsFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_MessageReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MessageReader *)o);
  new((void*)&(p->reader)) std::unique_ptr< arrow::ipc::MessageReader> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13MessageReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MessageReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *p = (struct __pyx_obj_7pyarrow_3lib_MessageReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MessageReader[] = {
  {"open_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13MessageReader_4open_stream},
  {"read_next_message", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_10read_next_message, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13MessageReader_9read_next_message},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_12__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13MessageReader_11__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_14__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13MessageReader_13__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MessageReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MessageReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MessageReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MessageReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "MessageReader()\n\n    Interface for reading Message objects from some source (like an\n    InputStream)\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_13MessageReader_7__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MessageReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_13MessageReader_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MessageReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)o);
  new((void*)&(p->sink)) std::shared_ptr<arrow::io::OutputStream> ();
  new((void*)&(p->options))  arrow::ipc::IpcOptions();
  if (unlikely(__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->sink);
  __Pyx_call_destructor(p->options);
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamWriter__use_legacy_format(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchStreamWriter[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchStreamWriter[] = {
  {(char *)"_use_legacy_format", __pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamWriter__use_legacy_format, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchStreamWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o);
  new((void*)&(p->in_stream)) std::shared_ptr<arrow::io::InputStream> ();
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->in_stream);
  Py_CLEAR(p->schema);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__CRecordBatchReader)) ? ((__pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader)); if (e) return e;
  if (p->schema) {
    e = (*v)(((PyObject *)p->schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__CRecordBatchReader)) { if (__pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_clear) __pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader);
  tmp = ((PyObject*)p->schema);
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchStreamReader[] = {
  {"_open", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_2_open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchStreamReader[] = {
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamReader_schema, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchStreamReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchStreamReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchStreamReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchStreamReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchFileWriter[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_1_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter__open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchFileWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchFileWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchFileWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o);
  new((void*)&(p->reader)) std::shared_ptr< arrow::ipc::RecordBatchFileReader> ();
  new((void*)&(p->file)) std::shared_ptr<arrow::io::RandomAccessFile> ();
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchFileReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->reader);
  __Pyx_call_destructor(p->file);
  Py_CLEAR(p->schema);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__RecordBatchFileReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  if (p->schema) {
    e = (*v)(((PyObject *)p->schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__RecordBatchFileReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  tmp = ((PyObject*)p->schema);
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_num_record_batches(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchFileReader[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_3_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_2_open},
  {"get_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_5get_batch, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch},
  {"read_all", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_7read_all, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_6read_all},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_10__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchFileReader[] = {
  {(char *)"num_record_batches", __pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_num_record_batches, 0, (char *)0, 0},
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_schema, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchFileReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchFileReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchFileReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__RecordBatchFileReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__RecordBatchFileReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchFileReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchFileReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FeatherWriter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)o);
  new((void*)&(p->writer)) std::unique_ptr< arrow::ipc::feather::TableWriter> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13FeatherWriter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_FeatherWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_FeatherWriter *p = (struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->writer);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherWriter_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_13FeatherWriter_num_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FeatherWriter[] = {
  {"open", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_3open, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherWriter_2open},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_5close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_4close},
  {"write_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13FeatherWriter_7write_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_6write_array},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FeatherWriter[] = {
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_13FeatherWriter_num_rows, __pyx_setprop_7pyarrow_3lib_13FeatherWriter_num_rows, (char *)"num_rows: 'int64_t'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FeatherWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FeatherWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FeatherWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_FeatherWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FeatherWriter, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FeatherWriter, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FeatherWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FeatherReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)o);
  new((void*)&(p->reader)) std::unique_ptr< arrow::ipc::feather::TableReader> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13FeatherReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_FeatherReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_FeatherReader *p = (struct __pyx_obj_7pyarrow_3lib_FeatherReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherReader_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherReader_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherReader_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherReader_11num_columns_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FeatherReader[] = {
  {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13FeatherReader_3open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13FeatherReader_2open},
  {"get_column_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_5get_column_name, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_4get_column_name},
  {"get_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_7get_column, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_6get_column},
  {"_read", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherReader_8_read},
  {"_read_indices", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_10_read_indices},
  {"_read_names", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_12_read_names},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherReader_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FeatherReader[] = {
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_13FeatherReader_num_rows, 0, (char *)0, 0},
  {(char *)"num_columns", __pyx_getprop_7pyarrow_3lib_13FeatherReader_num_columns, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FeatherReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FeatherReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FeatherReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_FeatherReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FeatherReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FeatherReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FeatherReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializationContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o);
  p->type_to_type_id = Py_None; Py_INCREF(Py_None);
  p->whitelisted_types = Py_None; Py_INCREF(Py_None);
  p->types_to_pickle = Py_None; Py_INCREF(Py_None);
  p->custom_serializers = Py_None; Py_INCREF(Py_None);
  p->custom_deserializers = Py_None; Py_INCREF(Py_None);
  p->pickle_serializer = Py_None; Py_INCREF(Py_None);
  p->pickle_deserializer = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SerializationContext(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type_to_type_id);
  Py_CLEAR(p->whitelisted_types);
  Py_CLEAR(p->types_to_pickle);
  Py_CLEAR(p->custom_serializers);
  Py_CLEAR(p->custom_deserializers);
  Py_CLEAR(p->pickle_serializer);
  Py_CLEAR(p->pickle_deserializer);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SerializationContext(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  if (p->type_to_type_id) {
    e = (*v)(p->type_to_type_id, a); if (e) return e;
  }
  if (p->whitelisted_types) {
    e = (*v)(p->whitelisted_types, a); if (e) return e;
  }
  if (p->types_to_pickle) {
    e = (*v)(p->types_to_pickle, a); if (e) return e;
  }
  if (p->custom_serializers) {
    e = (*v)(p->custom_serializers, a); if (e) return e;
  }
  if (p->custom_deserializers) {
    e = (*v)(p->custom_deserializers, a); if (e) return e;
  }
  if (p->pickle_serializer) {
    e = (*v)(p->pickle_serializer, a); if (e) return e;
  }
  if (p->pickle_deserializer) {
    e = (*v)(p->pickle_deserializer, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SerializationContext(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  tmp = ((PyObject*)p->type_to_type_id);
  p->type_to_type_id = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->whitelisted_types);
  p->whitelisted_types = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->types_to_pickle);
  p->types_to_pickle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->custom_serializers);
  p->custom_serializers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->custom_deserializers);
  p->custom_deserializers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pickle_serializer);
  p->pickle_serializer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pickle_deserializer);
  p->pickle_deserializer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SerializationContext[] = {
  {"set_pickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_2set_pickle},
  {"clone", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20SerializationContext_4clone},
  {"register_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_7register_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_6register_type},
  {"_serialize_callback", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_8_serialize_callback},
  {"_deserialize_callback", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_10_deserialize_callback},
  {"serialize", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_13serialize, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_12serialize},
  {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_15serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_14serialize_to},
  {"deserialize", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_17deserialize, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_16deserialize},
  {"deserialize_components", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_19deserialize_components, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_18deserialize_components},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20SerializationContext_20__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_22__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SerializationContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SerializationContext", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SerializationContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SerializationContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SerializationContext()", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SerializationContext, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SerializationContext, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SerializationContext, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SerializationContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject __pyx_vtable_7pyarrow_3lib_SerializedPyObject;

static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializedPyObject(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject;
  new((void*)&(p->data))  arrow::py::SerializedPyObject();
  p->base = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SerializedPyObject(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->data);
  Py_CLEAR(p->base);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SerializedPyObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  if (p->base) {
    e = (*v)(p->base, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SerializedPyObject(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  tmp = ((PyObject*)p->base);
  p->base = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18SerializedPyObject_total_bytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18SerializedPyObject_11total_bytes_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18SerializedPyObject_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18SerializedPyObject_4base_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SerializedPyObject[] = {
  {"write_to", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_1write_to, METH_O, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_write_to},
  {"deserialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_3deserialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_2deserialize},
  {"to_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_5to_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_4to_buffer},
  {"from_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_6from_components},
  {"to_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_9to_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_8to_components},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_SerializedPyObject[] = {
  {(char *)"total_bytes", __pyx_getprop_7pyarrow_3lib_18SerializedPyObject_total_bytes, 0, (char *)0, 0},
  {(char *)"base", __pyx_getprop_7pyarrow_3lib_18SerializedPyObject_base, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SerializedPyObject = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SerializedPyObject", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SerializedPyObject, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Arrow-serialized representation of Python object\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SerializedPyObject, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SerializedPyObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SerializedPyObject, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_SerializedPyObject, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SerializedPyObject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct____iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_1___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_2___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_pd);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o;
  if (p->__pyx_v_pd) {
    e = (*v)(p->__pyx_v_pd, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o;
  tmp = ((PyObject*)p->__pyx_v_pd);
  p->__pyx_v_pd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_3__datetime_conversion_functions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_4___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_4___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_4___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_4___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_4___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_5___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_6___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_chunk);
  Py_CLEAR(p->__pyx_v_item);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)o;
  if (p->__pyx_v_chunk) {
    e = (*v)(p->__pyx_v_chunk, a); if (e) return e;
  }
  if (p->__pyx_v_item) {
    e = (*v)(p->__pyx_v_item, 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_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;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_7___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_7___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_7___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_iterchunks[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_iterchunks = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_iterchunks(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_iterchunks > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_iterchunks[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_iterchunks];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_8_iterchunks(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_iterchunks < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_iterchunks[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_iterchunks++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_8_iterchunks(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, 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_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_iterchunks = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_8_iterchunks", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_iterchunks), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_8_iterchunks, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_8_iterchunks, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_iterchunks, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_itercolumns[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_itercolumns = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_itercolumns(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_itercolumns > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_itercolumns[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_itercolumns];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_9_itercolumns(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_itercolumns < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_itercolumns[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_itercolumns++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_9_itercolumns(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, 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_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_itercolumns = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_9_itercolumns", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_itercolumns), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_9_itercolumns, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_9_itercolumns, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_itercolumns, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10_download[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_download = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10_download(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_download > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10_download[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_download];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_10_download(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_cleanup);
  Py_CLEAR(p->__pyx_v_stream);
  Py_CLEAR(p->__pyx_v_write_queue);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_download < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10_download[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_download++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_10_download(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *)o;
  if (p->__pyx_v_cleanup) {
    e = (*v)(p->__pyx_v_cleanup, a); if (e) return e;
  }
  if (p->__pyx_v_stream) {
    e = (*v)(p->__pyx_v_stream, a); if (e) return e;
  }
  if (p->__pyx_v_write_queue) {
    e = (*v)(p->__pyx_v_write_queue, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_10_download(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download *)o;
  tmp = ((PyObject*)p->__pyx_v_cleanup);
  p->__pyx_v_cleanup = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_stream);
  p->__pyx_v_stream = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_write_queue);
  p->__pyx_v_write_queue = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_10_download = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_10_download", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_download), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_10_download, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_10_download, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_10_download, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10_download, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11_upload[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_upload = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_upload(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_upload > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11_upload[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_upload];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_11_upload(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_write_queue);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_upload < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11_upload[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_upload++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_11_upload(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_write_queue) {
    e = (*v)(p->__pyx_v_write_queue, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_11_upload(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_write_queue);
  p->__pyx_v_write_queue = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_upload = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_11_upload", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_upload), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_11_upload, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_11_upload, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_11_upload, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_upload, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_12___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_12___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_12___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_12___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_12___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_13___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_13___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_13___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_13___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_13___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_f);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *)o;
  if (p->__pyx_v_f) {
    e = (*v)(p->__pyx_v_f, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple *)o;
  tmp = ((PyObject*)p->__pyx_v_f);
  p->__pyx_v_f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_14_is_named_tuple", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_15_genexpr[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15_genexpr = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_15_genexpr[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_15_genexpr(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_n);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_15_genexpr[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_15_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_15_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_15_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_15_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"decimal128", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_67decimal128, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_66decimal128},
  {"list_", (PyCFunction)__pyx_pw_7pyarrow_3lib_81list_, METH_O, __pyx_doc_7pyarrow_3lib_80list_},
  {"large_list", (PyCFunction)__pyx_pw_7pyarrow_3lib_83large_list, METH_O, __pyx_doc_7pyarrow_3lib_82large_list},
  {"dictionary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_85dictionary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_84dictionary},
  {"_box_time_milli", (PyCFunction)__pyx_pw_7pyarrow_3lib_107_box_time_milli, METH_O, __pyx_doc_7pyarrow_3lib_106_box_time_milli},
  {"_box_time_micro", (PyCFunction)__pyx_pw_7pyarrow_3lib_109_box_time_micro, METH_O, __pyx_doc_7pyarrow_3lib_108_box_time_micro},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_lib(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_lib},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "lib",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_02d_02d, __pyx_k_02d_02d, sizeof(__pyx_k_02d_02d), 0, 1, 0, 0},
  {&__pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9, __pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9, sizeof(__pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9), 0, 1, 0, 0},
  {&__pyx_kp_u_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 1, 0, 0},
  {&__pyx_kp_u_0_19_0, __pyx_k_0_19_0, sizeof(__pyx_k_0_19_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_20_0, __pyx_k_0_20_0, sizeof(__pyx_k_0_20_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_23_0, __pyx_k_0_23_0, sizeof(__pyx_k_0_23_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_25, __pyx_k_0_25, sizeof(__pyx_k_0_25), 0, 1, 0, 0},
  {&__pyx_kp_u_0___class_____name___0, __pyx_k_0___class_____name___0, sizeof(__pyx_k_0___class_____name___0), 0, 1, 0, 0},
  {&__pyx_n_s_Array, __pyx_k_Array, sizeof(__pyx_k_Array), 0, 0, 1, 1},
  {&__pyx_n_s_ArrayValue, __pyx_k_ArrayValue, sizeof(__pyx_k_ArrayValue), 0, 0, 1, 1},
  {&__pyx_n_s_Array___iter, __pyx_k_Array___iter, sizeof(__pyx_k_Array___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Array_cast_line_517, __pyx_k_Array_cast_line_517, sizeof(__pyx_k_Array_cast_line_517), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_data_type_was_NULL, __pyx_k_Array_data_type_was_NULL, sizeof(__pyx_k_Array_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_filter_line_860, __pyx_k_Array_filter_line_860, sizeof(__pyx_k_Array_filter_line_860), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_take_line_817, __pyx_k_Array_take_line_817, sizeof(__pyx_k_Array_take_line_817), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_was_NULL, __pyx_k_Array_was_NULL, sizeof(__pyx_k_Array_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Arrays_were_not_all_the_same_len, __pyx_k_Arrays_were_not_all_the_same_len, sizeof(__pyx_k_Arrays_were_not_all_the_same_len), 0, 1, 0, 0},
  {&__pyx_n_s_ArrowCapacityError, __pyx_k_ArrowCapacityError, sizeof(__pyx_k_ArrowCapacityError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowException, __pyx_k_ArrowException, sizeof(__pyx_k_ArrowException), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowIOError, __pyx_k_ArrowIOError, sizeof(__pyx_k_ArrowIOError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowIndexError, __pyx_k_ArrowIndexError, sizeof(__pyx_k_ArrowIndexError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowInvalid, __pyx_k_ArrowInvalid, sizeof(__pyx_k_ArrowInvalid), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowKeyError, __pyx_k_ArrowKeyError, sizeof(__pyx_k_ArrowKeyError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowKeyError___str, __pyx_k_ArrowKeyError___str, sizeof(__pyx_k_ArrowKeyError___str), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowMemoryError, __pyx_k_ArrowMemoryError, sizeof(__pyx_k_ArrowMemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowNotImplementedError, __pyx_k_ArrowNotImplementedError, sizeof(__pyx_k_ArrowNotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowSerializationError, __pyx_k_ArrowSerializationError, sizeof(__pyx_k_ArrowSerializationError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowTypeError, __pyx_k_ArrowTypeError, sizeof(__pyx_k_ArrowTypeError), 0, 0, 1, 1},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_b_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 0, 1},
  {&__pyx_n_s_BaseExtensionType, __pyx_k_BaseExtensionType, sizeof(__pyx_k_BaseExtensionType), 0, 0, 1, 1},
  {&__pyx_n_s_BaseTzInfo, __pyx_k_BaseTzInfo, sizeof(__pyx_k_BaseTzInfo), 0, 0, 1, 1},
  {&__pyx_kp_u_Batch_number_0_out_of_range, __pyx_k_Batch_number_0_out_of_range, sizeof(__pyx_k_Batch_number_0_out_of_range), 0, 1, 0, 0},
  {&__pyx_n_s_BinaryArray, __pyx_k_BinaryArray, sizeof(__pyx_k_BinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_BinaryValue, __pyx_k_BinaryValue, sizeof(__pyx_k_BinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_BooleanArray, __pyx_k_BooleanArray, sizeof(__pyx_k_BooleanArray), 0, 0, 1, 1},
  {&__pyx_n_s_BooleanValue, __pyx_k_BooleanValue, sizeof(__pyx_k_BooleanValue), 0, 0, 1, 1},
  {&__pyx_n_s_Buffer, __pyx_k_Buffer, sizeof(__pyx_k_Buffer), 0, 0, 1, 1},
  {&__pyx_n_s_BufferError, __pyx_k_BufferError, sizeof(__pyx_k_BufferError), 0, 0, 1, 1},
  {&__pyx_n_s_BufferOutputStream, __pyx_k_BufferOutputStream, sizeof(__pyx_k_BufferOutputStream), 0, 0, 1, 1},
  {&__pyx_n_s_BufferReader, __pyx_k_BufferReader, sizeof(__pyx_k_BufferReader), 0, 0, 1, 1},
  {&__pyx_kp_u_Buffer_size_must_be_larger_than, __pyx_k_Buffer_size_must_be_larger_than, sizeof(__pyx_k_Buffer_size_must_be_larger_than), 0, 1, 0, 0},
  {&__pyx_n_s_BufferedIOBase, __pyx_k_BufferedIOBase, sizeof(__pyx_k_BufferedIOBase), 0, 0, 1, 1},
  {&__pyx_n_s_BufferedInputStream, __pyx_k_BufferedInputStream, sizeof(__pyx_k_BufferedInputStream), 0, 0, 1, 1},
  {&__pyx_n_s_BufferedOutputStream, __pyx_k_BufferedOutputStream, sizeof(__pyx_k_BufferedOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_CPU_count_must_be_strictly_posit, __pyx_k_CPU_count_must_be_strictly_posit, sizeof(__pyx_k_CPU_count_must_be_strictly_posit), 0, 1, 0, 0},
  {&__pyx_n_s_CRecordBatchReader, __pyx_k_CRecordBatchReader, sizeof(__pyx_k_CRecordBatchReader), 0, 0, 1, 1},
  {&__pyx_n_s_CRecordBatchReader___iter, __pyx_k_CRecordBatchReader___iter, sizeof(__pyx_k_CRecordBatchReader___iter), 0, 0, 1, 1},
  {&__pyx_n_s_CRecordBatchWriter, __pyx_k_CRecordBatchWriter, sizeof(__pyx_k_CRecordBatchWriter), 0, 0, 1, 1},
  {&__pyx_kp_u_Calling_data_on_ChunkedArray_is, __pyx_k_Calling_data_on_ChunkedArray_is, sizeof(__pyx_k_Calling_data_on_ChunkedArray_is), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_only_instantiate_subclasses, __pyx_k_Can_only_instantiate_subclasses, sizeof(__pyx_k_Can_only_instantiate_subclasses), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_only_instantiate_subclasses_2, __pyx_k_Can_only_instantiate_subclasses_2, sizeof(__pyx_k_Can_only_instantiate_subclasses_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_compare_Arrow_values_that, __pyx_k_Cannot_compare_Arrow_values_that, sizeof(__pyx_k_Cannot_compare_Arrow_values_that), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_compare_scalars_that_don, __pyx_k_Cannot_compare_scalars_that_don, sizeof(__pyx_k_Cannot_compare_scalars_that_don), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_construct_a_chunked_array, __pyx_k_Cannot_construct_a_chunked_array, sizeof(__pyx_k_Cannot_construct_a_chunked_array), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_convert_nanosecond_timest, __pyx_k_Cannot_convert_nanosecond_timest, sizeof(__pyx_k_Cannot_convert_nanosecond_timest), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_create_multiple_NAType_in, __pyx_k_Cannot_create_multiple_NAType_in, sizeof(__pyx_k_Cannot_create_multiple_NAType_in), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pass_a_numpy_masked_array, __pyx_k_Cannot_pass_a_numpy_masked_array, sizeof(__pyx_k_Cannot_pass_a_numpy_masked_array), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pass_both_schema_and_meta, __pyx_k_Cannot_pass_both_schema_and_meta, sizeof(__pyx_k_Cannot_pass_both_schema_and_meta), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pass_both_schema_and_name, __pyx_k_Cannot_pass_both_schema_and_name, sizeof(__pyx_k_Cannot_pass_both_schema_and_name), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_specify_a_mask_or_a_size, __pyx_k_Cannot_specify_a_mask_or_a_size, sizeof(__pyx_k_Cannot_specify_a_mask_or_a_size), 0, 1, 0, 0},
  {&__pyx_kp_u_Cast_array_values_to_another_da, __pyx_k_Cast_array_values_to_another_da, sizeof(__pyx_k_Cast_array_values_to_another_da), 0, 1, 0, 0},
  {&__pyx_n_s_Categorical, __pyx_k_Categorical, sizeof(__pyx_k_Categorical), 0, 0, 1, 1},
  {&__pyx_kp_u_Chunk_index_out_of_range, __pyx_k_Chunk_index_out_of_range, sizeof(__pyx_k_Chunk_index_out_of_range), 0, 1, 0, 0},
  {&__pyx_n_s_ChunkedArray, __pyx_k_ChunkedArray, sizeof(__pyx_k_ChunkedArray), 0, 0, 1, 1},
  {&__pyx_n_s_ChunkedArray___iter, __pyx_k_ChunkedArray___iter, sizeof(__pyx_k_ChunkedArray___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_ChunkedArray_data_type_was_NULL, __pyx_k_ChunkedArray_data_type_was_NULL, sizeof(__pyx_k_ChunkedArray_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_ChunkedArray_iterchunks, __pyx_k_ChunkedArray_iterchunks, sizeof(__pyx_k_ChunkedArray_iterchunks), 0, 0, 1, 1},
  {&__pyx_kp_u_ChunkedArray_was_NULL, __pyx_k_ChunkedArray_was_NULL, sizeof(__pyx_k_ChunkedArray_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Column_does_not_exist_in_schema, __pyx_k_Column_does_not_exist_in_schema, sizeof(__pyx_k_Column_does_not_exist_in_schema), 0, 1, 0, 0},
  {&__pyx_kp_u_Column_does_not_exist_in_table, __pyx_k_Column_does_not_exist_in_table, sizeof(__pyx_k_Column_does_not_exist_in_table), 0, 1, 0, 0},
  {&__pyx_kp_u_Column_r_not_found, __pyx_k_Column_r_not_found, sizeof(__pyx_k_Column_r_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Comparisons_with_pyarrow_Array_a, __pyx_k_Comparisons_with_pyarrow_Array_a, sizeof(__pyx_k_Comparisons_with_pyarrow_Array_a), 0, 1, 0, 0},
  {&__pyx_n_s_CompressedInputStream, __pyx_k_CompressedInputStream, sizeof(__pyx_k_CompressedInputStream), 0, 0, 1, 1},
  {&__pyx_n_s_CompressedOutputStream, __pyx_k_CompressedOutputStream, sizeof(__pyx_k_CompressedOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_Convert_pandas_DataFrame_to_an, __pyx_k_Convert_pandas_DataFrame_to_an, sizeof(__pyx_k_Convert_pandas_DataFrame_to_an), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_pyarrow_Array_instance_f, __pyx_k_Create_pyarrow_Array_instance_f, sizeof(__pyx_k_Create_pyarrow_Array_instance_f), 0, 1, 0, 0},
  {&__pyx_n_s_DEFAULT_BUFFER_SIZE, __pyx_k_DEFAULT_BUFFER_SIZE, sizeof(__pyx_k_DEFAULT_BUFFER_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1},
  {&__pyx_n_s_DataType, __pyx_k_DataType, sizeof(__pyx_k_DataType), 0, 0, 1, 1},
  {&__pyx_kp_u_DataType_expected_got_r, __pyx_k_DataType_expected_got_r, sizeof(__pyx_k_DataType_expected_got_r), 0, 1, 0, 0},
  {&__pyx_n_s_Date32Array, __pyx_k_Date32Array, sizeof(__pyx_k_Date32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Date32Value, __pyx_k_Date32Value, sizeof(__pyx_k_Date32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Date64Array, __pyx_k_Date64Array, sizeof(__pyx_k_Date64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Date64Value, __pyx_k_Date64Value, sizeof(__pyx_k_Date64Value), 0, 0, 1, 1},
  {&__pyx_n_s_DatetimeTZDtype, __pyx_k_DatetimeTZDtype, sizeof(__pyx_k_DatetimeTZDtype), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal128Array, __pyx_k_Decimal128Array, sizeof(__pyx_k_Decimal128Array), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal128Type, __pyx_k_Decimal128Type, sizeof(__pyx_k_Decimal128Type), 0, 0, 1, 1},
  {&__pyx_n_s_DecimalValue, __pyx_k_DecimalValue, sizeof(__pyx_k_DecimalValue), 0, 0, 1, 1},
  {&__pyx_n_s_DeserializationCallbackError, __pyx_k_DeserializationCallbackError, sizeof(__pyx_k_DeserializationCallbackError), 0, 0, 1, 1},
  {&__pyx_n_s_DeserializationCallbackError___i, __pyx_k_DeserializationCallbackError___i, sizeof(__pyx_k_DeserializationCallbackError___i), 0, 0, 1, 1},
  {&__pyx_n_s_DictionaryArray, __pyx_k_DictionaryArray, sizeof(__pyx_k_DictionaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_DictionaryMemo, __pyx_k_DictionaryMemo, sizeof(__pyx_k_DictionaryMemo), 0, 0, 1, 1},
  {&__pyx_n_s_DictionaryType, __pyx_k_DictionaryType, sizeof(__pyx_k_DictionaryType), 0, 0, 1, 1},
  {&__pyx_n_s_DictionaryValue, __pyx_k_DictionaryValue, sizeof(__pyx_k_DictionaryValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Do_not_call_Buffer_s_constructor, __pyx_k_Do_not_call_Buffer_s_constructor, sizeof(__pyx_k_Do_not_call_Buffer_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_ChunkedArray_s_const, __pyx_k_Do_not_call_ChunkedArray_s_const, sizeof(__pyx_k_Do_not_call_ChunkedArray_s_const), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Field_s_constructor, __pyx_k_Do_not_call_Field_s_constructor, sizeof(__pyx_k_Do_not_call_Field_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_RecordBatch_s_constr, __pyx_k_Do_not_call_RecordBatch_s_constr, sizeof(__pyx_k_Do_not_call_RecordBatch_s_constr), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Schema_s_constructor, __pyx_k_Do_not_call_Schema_s_constructor, sizeof(__pyx_k_Do_not_call_Schema_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_SparseTensorCOO_s_co, __pyx_k_Do_not_call_SparseTensorCOO_s_co, sizeof(__pyx_k_Do_not_call_SparseTensorCOO_s_co), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_SparseTensorCSR_s_co, __pyx_k_Do_not_call_SparseTensorCSR_s_co, sizeof(__pyx_k_Do_not_call_SparseTensorCSR_s_co), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Table_s_constructor, __pyx_k_Do_not_call_Table_s_constructor, sizeof(__pyx_k_Do_not_call_Table_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Tensor_s_constructor, __pyx_k_Do_not_call_Tensor_s_constructor, sizeof(__pyx_k_Do_not_call_Tensor_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct, __pyx_k_Do_not_call_s_constructor_direct, sizeof(__pyx_k_Do_not_call_s_constructor_direct), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_2, __pyx_k_Do_not_call_s_constructor_direct_2, sizeof(__pyx_k_Do_not_call_s_constructor_direct_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_3, __pyx_k_Do_not_call_s_constructor_direct_3, sizeof(__pyx_k_Do_not_call_s_constructor_direct_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_4, __pyx_k_Do_not_call_s_constructor_direct_4, sizeof(__pyx_k_Do_not_call_s_constructor_direct_4), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_5, __pyx_k_Do_not_call_s_constructor_direct_5, sizeof(__pyx_k_Do_not_call_s_constructor_direct_5), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_6, __pyx_k_Do_not_call_s_constructor_direct_6, sizeof(__pyx_k_Do_not_call_s_constructor_direct_6), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_7, __pyx_k_Do_not_call_s_constructor_direct_7, sizeof(__pyx_k_Do_not_call_s_constructor_direct_7), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_8, __pyx_k_Do_not_call_s_constructor_direct_8, sizeof(__pyx_k_Do_not_call_s_constructor_direct_8), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_9, __pyx_k_Do_not_call_s_constructor_direct_9, sizeof(__pyx_k_Do_not_call_s_constructor_direct_9), 0, 1, 0, 0},
  {&__pyx_n_s_DoubleArray, __pyx_k_DoubleArray, sizeof(__pyx_k_DoubleArray), 0, 0, 1, 1},
  {&__pyx_n_s_DoubleScalar, __pyx_k_DoubleScalar, sizeof(__pyx_k_DoubleScalar), 0, 0, 1, 1},
  {&__pyx_n_s_DoubleValue, __pyx_k_DoubleValue, sizeof(__pyx_k_DoubleValue), 0, 0, 1, 1},
  {&__pyx_n_s_EOFError, __pyx_k_EOFError, sizeof(__pyx_k_EOFError), 0, 0, 1, 1},
  {&__pyx_n_s_Empty, __pyx_k_Empty, sizeof(__pyx_k_Empty), 0, 0, 1, 1},
  {&__pyx_kp_u_End_of_Arrow_stream, __pyx_k_End_of_Arrow_stream, sizeof(__pyx_k_End_of_Arrow_stream), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_1_dimensional_array_for, __pyx_k_Expected_1_dimensional_array_for, sizeof(__pyx_k_Expected_1_dimensional_array_for), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_1_dimensional_array_for_2, __pyx_k_Expected_1_dimensional_array_for_2, sizeof(__pyx_k_Expected_1_dimensional_array_for_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_2_dimensional_array_for, __pyx_k_Expected_2_dimensional_array_for, sizeof(__pyx_k_Expected_2_dimensional_array_for), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_integer_or_string_index, __pyx_k_Expected_integer_or_string_index, sizeof(__pyx_k_Expected_integer_or_string_index), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_pandas_DataFrame_or_pyt, __pyx_k_Expected_pandas_DataFrame_or_pyt, sizeof(__pyx_k_Expected_pandas_DataFrame_or_pyt), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_storage_type_0_but_got, __pyx_k_Expected_storage_type_0_but_got, sizeof(__pyx_k_Expected_storage_type_0_but_got), 0, 1, 0, 0},
  {&__pyx_n_s_ExtensionArray, __pyx_k_ExtensionArray, sizeof(__pyx_k_ExtensionArray), 0, 0, 1, 1},
  {&__pyx_n_s_ExtensionRegistryNanny, __pyx_k_ExtensionRegistryNanny, sizeof(__pyx_k_ExtensionRegistryNanny), 0, 0, 1, 1},
  {&__pyx_n_s_ExtensionType, __pyx_k_ExtensionType, sizeof(__pyx_k_ExtensionType), 0, 0, 1, 1},
  {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1},
  {&__pyx_n_s_FIXED_OFFSET_RE, __pyx_k_FIXED_OFFSET_RE, sizeof(__pyx_k_FIXED_OFFSET_RE), 0, 0, 1, 1},
  {&__pyx_kp_u_Failed_to_allocate_0_bytes, __pyx_k_Failed_to_allocate_0_bytes, sizeof(__pyx_k_Failed_to_allocate_0_bytes), 0, 1, 0, 0},
  {&__pyx_n_s_FeatherError, __pyx_k_FeatherError, sizeof(__pyx_k_FeatherError), 0, 0, 1, 1},
  {&__pyx_n_s_FeatherReader, __pyx_k_FeatherReader, sizeof(__pyx_k_FeatherReader), 0, 0, 1, 1},
  {&__pyx_n_s_FeatherWriter, __pyx_k_FeatherWriter, sizeof(__pyx_k_FeatherWriter), 0, 0, 1, 1},
  {&__pyx_n_s_Field, __pyx_k_Field, sizeof(__pyx_k_Field), 0, 0, 1, 1},
  {&__pyx_kp_u_File_object_is_malformed_has_no, __pyx_k_File_object_is_malformed_has_no, sizeof(__pyx_k_File_object_is_malformed_has_no), 0, 1, 0, 0},
  {&__pyx_kp_u_Filter_the_array_with_a_boolean, __pyx_k_Filter_the_array_with_a_boolean, sizeof(__pyx_k_Filter_the_array_with_a_boolean), 0, 1, 0, 0},
  {&__pyx_n_s_FixedOffset, __pyx_k_FixedOffset, sizeof(__pyx_k_FixedOffset), 0, 0, 1, 1},
  {&__pyx_n_s_FixedOffset_2, __pyx_k_FixedOffset_2, sizeof(__pyx_k_FixedOffset_2), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryArray, __pyx_k_FixedSizeBinaryArray, sizeof(__pyx_k_FixedSizeBinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryType, __pyx_k_FixedSizeBinaryType, sizeof(__pyx_k_FixedSizeBinaryType), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryValue, __pyx_k_FixedSizeBinaryValue, sizeof(__pyx_k_FixedSizeBinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBufferWriter, __pyx_k_FixedSizeBufferWriter, sizeof(__pyx_k_FixedSizeBufferWriter), 0, 0, 1, 1},
  {&__pyx_n_s_FloatArray, __pyx_k_FloatArray, sizeof(__pyx_k_FloatArray), 0, 0, 1, 1},
  {&__pyx_n_s_FloatScalar, __pyx_k_FloatScalar, sizeof(__pyx_k_FloatScalar), 0, 0, 1, 1},
  {&__pyx_n_s_FloatValue, __pyx_k_FloatValue, sizeof(__pyx_k_FloatValue), 0, 0, 1, 1},
  {&__pyx_n_s_FloatingPointArray, __pyx_k_FloatingPointArray, sizeof(__pyx_k_FloatingPointArray), 0, 0, 1, 1},
  {&__pyx_n_s_Full, __pyx_k_Full, sizeof(__pyx_k_Full), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionContext, __pyx_k_FunctionContext, sizeof(__pyx_k_FunctionContext), 0, 0, 1, 1},
  {&__pyx_n_s_FutureWarning, __pyx_k_FutureWarning, sizeof(__pyx_k_FutureWarning), 0, 0, 1, 1},
  {&__pyx_n_b_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 0, 1},
  {&__pyx_n_s_HDFS_PATH_RE, __pyx_k_HDFS_PATH_RE, sizeof(__pyx_k_HDFS_PATH_RE), 0, 0, 1, 1},
  {&__pyx_kp_u_HDFS_client_improperly_initializ, __pyx_k_HDFS_client_improperly_initializ, sizeof(__pyx_k_HDFS_client_improperly_initializ), 0, 1, 0, 0},
  {&__pyx_kp_u_HDFS_client_is_closed, __pyx_k_HDFS_client_is_closed, sizeof(__pyx_k_HDFS_client_is_closed), 0, 1, 0, 0},
  {&__pyx_n_s_HadoopFileSystem, __pyx_k_HadoopFileSystem, sizeof(__pyx_k_HadoopFileSystem), 0, 0, 1, 1},
  {&__pyx_n_s_HalfFloatArray, __pyx_k_HalfFloatArray, sizeof(__pyx_k_HalfFloatArray), 0, 0, 1, 1},
  {&__pyx_n_s_HalfFloatValue, __pyx_k_HalfFloatValue, sizeof(__pyx_k_HalfFloatValue), 0, 0, 1, 1},
  {&__pyx_n_s_HdfsFile, __pyx_k_HdfsFile, sizeof(__pyx_k_HdfsFile), 0, 0, 1, 1},
  {&__pyx_n_s_HdfsFileNanny, __pyx_k_HdfsFileNanny, sizeof(__pyx_k_HdfsFileNanny), 0, 0, 1, 1},
  {&__pyx_n_b_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 0, 1},
  {&__pyx_n_s_IOBase, __pyx_k_IOBase, sizeof(__pyx_k_IOBase), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_kp_u_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 1, 0, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x59, __pyx_k_Incompatible_checksums_s_vs_0x59, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x59), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_k_Incompatible_checksums_s_vs_0x9a, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x9a), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xf9, __pyx_k_Incompatible_checksums_s_vs_0xf9, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf9), 0, 0, 1, 0},
  {&__pyx_kp_u_Incompatible_storage_type_0_for, __pyx_k_Incompatible_storage_type_0_for, sizeof(__pyx_k_Incompatible_storage_type_0_for), 0, 1, 0, 0},
  {&__pyx_n_s_Index, __pyx_k_Index, sizeof(__pyx_k_Index), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_u_Index_must_either_be_string_or_i, __pyx_k_Index_must_either_be_string_or_i, sizeof(__pyx_k_Index_must_either_be_string_or_i), 0, 1, 0, 0},
  {&__pyx_kp_u_Indices_must_be_integer_type, __pyx_k_Indices_must_be_integer_type, sizeof(__pyx_k_Indices_must_be_integer_type), 0, 1, 0, 0},
  {&__pyx_n_s_Int16Array, __pyx_k_Int16Array, sizeof(__pyx_k_Int16Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int16Scalar, __pyx_k_Int16Scalar, sizeof(__pyx_k_Int16Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int16Value, __pyx_k_Int16Value, sizeof(__pyx_k_Int16Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Array, __pyx_k_Int32Array, sizeof(__pyx_k_Int32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Scalar, __pyx_k_Int32Scalar, sizeof(__pyx_k_Int32Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Value, __pyx_k_Int32Value, sizeof(__pyx_k_Int32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Array, __pyx_k_Int64Array, sizeof(__pyx_k_Int64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Scalar, __pyx_k_Int64Scalar, sizeof(__pyx_k_Int64Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Value, __pyx_k_Int64Value, sizeof(__pyx_k_Int64Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Array, __pyx_k_Int8Array, sizeof(__pyx_k_Int8Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Scalar, __pyx_k_Int8Scalar, sizeof(__pyx_k_Int8Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Value, __pyx_k_Int8Value, sizeof(__pyx_k_Int8Value), 0, 0, 1, 1},
  {&__pyx_n_s_IntegerArray, __pyx_k_IntegerArray, sizeof(__pyx_k_IntegerArray), 0, 0, 1, 1},
  {&__pyx_kp_u_Invalid_TimeUnit_for_time32, __pyx_k_Invalid_TimeUnit_for_time32, sizeof(__pyx_k_Invalid_TimeUnit_for_time32), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_TimeUnit_for_time64, __pyx_k_Invalid_TimeUnit_for_time64, sizeof(__pyx_k_Invalid_TimeUnit_for_time64), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_TimeUnit_string, __pyx_k_Invalid_TimeUnit_string, sizeof(__pyx_k_Invalid_TimeUnit_string), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_file_mode_0, __pyx_k_Invalid_file_mode_0, sizeof(__pyx_k_Invalid_file_mode_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_union_mode_0_r, __pyx_k_Invalid_union_mode_0_r, sizeof(__pyx_k_Invalid_union_mode_0_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_value_for_compression_r, __pyx_k_Invalid_value_for_compression_r, sizeof(__pyx_k_Invalid_value_for_compression_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_value_of_whence_0, __pyx_k_Invalid_value_of_whence_0, sizeof(__pyx_k_Invalid_value_of_whence_0), 0, 1, 0, 0},
  {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_LargeBinaryArray, __pyx_k_LargeBinaryArray, sizeof(__pyx_k_LargeBinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_LargeBinaryValue, __pyx_k_LargeBinaryValue, sizeof(__pyx_k_LargeBinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListArray, __pyx_k_LargeListArray, sizeof(__pyx_k_LargeListArray), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListType, __pyx_k_LargeListType, sizeof(__pyx_k_LargeListType), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListValue, __pyx_k_LargeListValue, sizeof(__pyx_k_LargeListValue), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListValue___iter, __pyx_k_LargeListValue___iter, sizeof(__pyx_k_LargeListValue___iter), 0, 0, 1, 1},
  {&__pyx_n_s_LargeStringArray, __pyx_k_LargeStringArray, sizeof(__pyx_k_LargeStringArray), 0, 0, 1, 1},
  {&__pyx_n_s_LargeStringValue, __pyx_k_LargeStringValue, sizeof(__pyx_k_LargeStringValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Length_of_names_does_not_match_l, __pyx_k_Length_of_names_does_not_match_l, sizeof(__pyx_k_Length_of_names_does_not_match_l), 0, 1, 0, 0},
  {&__pyx_n_s_ListArray, __pyx_k_ListArray, sizeof(__pyx_k_ListArray), 0, 0, 1, 1},
  {&__pyx_n_s_ListType, __pyx_k_ListType, sizeof(__pyx_k_ListType), 0, 0, 1, 1},
  {&__pyx_n_s_ListValue, __pyx_k_ListValue, sizeof(__pyx_k_ListValue), 0, 0, 1, 1},
  {&__pyx_n_s_ListValue___iter, __pyx_k_ListValue___iter, sizeof(__pyx_k_ListValue___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_List_requires_DataType_or_Field, __pyx_k_List_requires_DataType_or_Field, sizeof(__pyx_k_List_requires_DataType_or_Field), 0, 1, 0, 0},
  {&__pyx_n_s_LoggingMemoryPool, __pyx_k_LoggingMemoryPool, sizeof(__pyx_k_LoggingMemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1},
  {&__pyx_n_s_Mapping, __pyx_k_Mapping, sizeof(__pyx_k_Mapping), 0, 0, 1, 1},
  {&__pyx_n_s_MaskedArray, __pyx_k_MaskedArray, sizeof(__pyx_k_MaskedArray), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryMappedFile, __pyx_k_MemoryMappedFile, sizeof(__pyx_k_MemoryMappedFile), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryPool, __pyx_k_MemoryPool, sizeof(__pyx_k_MemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_Message, __pyx_k_Message, sizeof(__pyx_k_Message), 0, 0, 1, 1},
  {&__pyx_n_s_MessageReader, __pyx_k_MessageReader, sizeof(__pyx_k_MessageReader), 0, 0, 1, 1},
  {&__pyx_n_s_MessageReader___iter, __pyx_k_MessageReader___iter, sizeof(__pyx_k_MessageReader___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Metadata_must_be_an_instance_of, __pyx_k_Metadata_must_be_an_instance_of, sizeof(__pyx_k_Metadata_must_be_an_instance_of), 0, 1, 0, 0},
  {&__pyx_n_s_MockOutputStream, __pyx_k_MockOutputStream, sizeof(__pyx_k_MockOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_Mode_must_be_rb_read_wb_write_ne, __pyx_k_Mode_must_be_rb_read_wb_write_ne, sizeof(__pyx_k_Mode_must_be_rb_read_wb_write_ne), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_be_an_instance_of_datetime, __pyx_k_Must_be_an_instance_of_datetime, sizeof(__pyx_k_Must_be_an_instance_of_datetime), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_decompressed_size_for, __pyx_k_Must_pass_decompressed_size_for, sizeof(__pyx_k_Must_pass_decompressed_size_for), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_either_names_or_fields, __pyx_k_Must_pass_either_names_or_fields, sizeof(__pyx_k_Must_pass_either_names_or_fields), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_either_names_or_fields_2, __pyx_k_Must_pass_either_names_or_fields_2, sizeof(__pyx_k_Must_pass_either_names_or_fields_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_names_or_schema_to_Tab, __pyx_k_Must_pass_names_or_schema_to_Tab, sizeof(__pyx_k_Must_pass_names_or_schema_to_Tab), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_schema_or_at_least_one, __pyx_k_Must_pass_schema_or_at_least_one, sizeof(__pyx_k_Must_pass_schema_or_at_least_one), 0, 1, 0, 0},
  {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 1, 1},
  {&__pyx_n_s_NAType, __pyx_k_NAType, sizeof(__pyx_k_NAType), 0, 0, 1, 1},
  {&__pyx_n_u_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 1, 0, 1},
  {&__pyx_n_s_NULL_2, __pyx_k_NULL_2, sizeof(__pyx_k_NULL_2), 0, 0, 1, 1},
  {&__pyx_kp_u_Nanosecond_timestamp_is_not_safe, __pyx_k_Nanosecond_timestamp_is_not_safe, sizeof(__pyx_k_Nanosecond_timestamp_is_not_safe), 0, 1, 0, 0},
  {&__pyx_n_s_NativeFile, __pyx_k_NativeFile, sizeof(__pyx_k_NativeFile), 0, 0, 1, 1},
  {&__pyx_kp_u_No_type_alias_for_0, __pyx_k_No_type_alias_for_0, sizeof(__pyx_k_No_type_alias_for_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Non_fixed_width_type, __pyx_k_Non_fixed_width_type, sizeof(__pyx_k_Non_fixed_width_type), 0, 1, 0, 0},
  {&__pyx_n_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_NullArray, __pyx_k_NullArray, sizeof(__pyx_k_NullArray), 0, 0, 1, 1},
  {&__pyx_n_s_NullType, __pyx_k_NullType, sizeof(__pyx_k_NullType), 0, 0, 1, 1},
  {&__pyx_kp_u_NumPy_array_view_is_only_support, __pyx_k_NumPy_array_view_is_only_support, sizeof(__pyx_k_NumPy_array_view_is_only_support), 0, 1, 0, 0},
  {&__pyx_kp_u_NumPy_array_view_is_only_support_2, __pyx_k_NumPy_array_view_is_only_support_2, sizeof(__pyx_k_NumPy_array_view_is_only_support_2), 0, 1, 0, 0},
  {&__pyx_n_s_NumericArray, __pyx_k_NumericArray, sizeof(__pyx_k_NumericArray), 0, 0, 1, 1},
  {&__pyx_n_s_OSFile, __pyx_k_OSFile, sizeof(__pyx_k_OSFile), 0, 0, 1, 1},
  {&__pyx_kp_u_Offset_must_be_non_negative, __pyx_k_Offset_must_be_non_negative, sizeof(__pyx_k_Offset_must_be_non_negative), 0, 1, 0, 0},
  {&__pyx_kp_u_Offset_must_represent_whole_numb, __pyx_k_Offset_must_represent_whole_numb, sizeof(__pyx_k_Offset_must_represent_whole_numb), 0, 1, 0, 0},
  {&__pyx_kp_u_Only_extension_types_can_be_regi, __pyx_k_Only_extension_types_can_be_regi, sizeof(__pyx_k_Only_extension_types_can_be_regi), 0, 1, 0, 0},
  {&__pyx_n_s_PY3, __pyx_k_PY3, sizeof(__pyx_k_PY3), 0, 0, 1, 1},
  {&__pyx_n_s_PandasAPIShim, __pyx_k_PandasAPIShim, sizeof(__pyx_k_PandasAPIShim), 0, 0, 1, 1},
  {&__pyx_n_s_PandasConvertible, __pyx_k_PandasConvertible, sizeof(__pyx_k_PandasConvertible), 0, 0, 1, 1},
  {&__pyx_n_s_PickleBuffer, __pyx_k_PickleBuffer, sizeof(__pyx_k_PickleBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_u_Please_implement_0___reduce, __pyx_k_Please_implement_0___reduce, sizeof(__pyx_k_Please_implement_0___reduce), 0, 1, 0, 0},
  {&__pyx_kp_u_Please_use_read_next_batch_inste, __pyx_k_Please_use_read_next_batch_inste, sizeof(__pyx_k_Please_use_read_next_batch_inste), 0, 1, 0, 0},
  {&__pyx_n_s_ProxyMemoryPool, __pyx_k_ProxyMemoryPool, sizeof(__pyx_k_ProxyMemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_PyExtensionType, __pyx_k_PyExtensionType, sizeof(__pyx_k_PyExtensionType), 0, 0, 1, 1},
  {&__pyx_n_s_PythonFile, __pyx_k_PythonFile, sizeof(__pyx_k_PythonFile), 0, 0, 1, 1},
  {&__pyx_n_b_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 0, 1},
  {&__pyx_n_s_Queue, __pyx_k_Queue, sizeof(__pyx_k_Queue), 0, 0, 1, 1},
  {&__pyx_n_s_QueueEmpty, __pyx_k_QueueEmpty, sizeof(__pyx_k_QueueEmpty), 0, 0, 1, 1},
  {&__pyx_n_s_QueueFull, __pyx_k_QueueFull, sizeof(__pyx_k_QueueFull), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatch, __pyx_k_RecordBatch, sizeof(__pyx_k_RecordBatch), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchFileReader, __pyx_k_RecordBatchFileReader, sizeof(__pyx_k_RecordBatchFileReader), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchFileWriter, __pyx_k_RecordBatchFileWriter, sizeof(__pyx_k_RecordBatchFileWriter), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchStreamReader, __pyx_k_RecordBatchStreamReader, sizeof(__pyx_k_RecordBatchStreamReader), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchStreamWriter, __pyx_k_RecordBatchStreamWriter, sizeof(__pyx_k_RecordBatchStreamWriter), 0, 0, 1, 1},
  {&__pyx_n_s_ResizableBuffer, __pyx_k_ResizableBuffer, sizeof(__pyx_k_ResizableBuffer), 0, 0, 1, 1},
  {&__pyx_kp_u_Returns_implied_schema_from_dat, __pyx_k_Returns_implied_schema_from_dat, sizeof(__pyx_k_Returns_implied_schema_from_dat), 0, 1, 0, 0},
  {&__pyx_n_s_Scalar, __pyx_k_Scalar, sizeof(__pyx_k_Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_ScalarValue, __pyx_k_ScalarValue, sizeof(__pyx_k_ScalarValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Scalar_data_type_was_NULL, __pyx_k_Scalar_data_type_was_NULL, sizeof(__pyx_k_Scalar_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Scalar_was_NULL, __pyx_k_Scalar_was_NULL, sizeof(__pyx_k_Scalar_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_Schema, __pyx_k_Schema, sizeof(__pyx_k_Schema), 0, 0, 1, 1},
  {&__pyx_n_s_Schema___iter, __pyx_k_Schema___iter, sizeof(__pyx_k_Schema___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Schema_and_number_of_arrays_uneq, __pyx_k_Schema_and_number_of_arrays_uneq, sizeof(__pyx_k_Schema_and_number_of_arrays_uneq), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_field_name_corresponds_to, __pyx_k_Schema_field_name_corresponds_to, sizeof(__pyx_k_Schema_field_name_corresponds_to), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_from_pandas_line_963, __pyx_k_Schema_from_pandas_line_963, sizeof(__pyx_k_Schema_from_pandas_line_963), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_passed_to_names_option_pl, __pyx_k_Schema_passed_to_names_option_pl, sizeof(__pyx_k_Schema_passed_to_names_option_pl), 0, 1, 0, 0},
  {&__pyx_n_s_SerializationCallbackError, __pyx_k_SerializationCallbackError, sizeof(__pyx_k_SerializationCallbackError), 0, 0, 1, 1},
  {&__pyx_n_s_SerializationCallbackError___ini, __pyx_k_SerializationCallbackError___ini, sizeof(__pyx_k_SerializationCallbackError___ini), 0, 0, 1, 1},
  {&__pyx_n_s_SerializationContext, __pyx_k_SerializationContext, sizeof(__pyx_k_SerializationContext), 0, 0, 1, 1},
  {&__pyx_n_s_SerializedPyObject, __pyx_k_SerializedPyObject, sizeof(__pyx_k_SerializedPyObject), 0, 0, 1, 1},
  {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1},
  {&__pyx_n_s_SparseTensorCOO, __pyx_k_SparseTensorCOO, sizeof(__pyx_k_SparseTensorCOO), 0, 0, 1, 1},
  {&__pyx_kp_u_SparseTensorCOO_was_NULL, __pyx_k_SparseTensorCOO_was_NULL, sizeof(__pyx_k_SparseTensorCOO_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_SparseTensorCSR, __pyx_k_SparseTensorCSR, sizeof(__pyx_k_SparseTensorCSR), 0, 0, 1, 1},
  {&__pyx_kp_u_SparseTensorCSR_was_NULL, __pyx_k_SparseTensorCSR_was_NULL, sizeof(__pyx_k_SparseTensorCSR_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_StringArray, __pyx_k_StringArray, sizeof(__pyx_k_StringArray), 0, 0, 1, 1},
  {&__pyx_n_s_StringBuilder, __pyx_k_StringBuilder, sizeof(__pyx_k_StringBuilder), 0, 0, 1, 1},
  {&__pyx_kp_u_StringBuilder_only_accepts_strin, __pyx_k_StringBuilder_only_accepts_strin, sizeof(__pyx_k_StringBuilder_only_accepts_strin), 0, 1, 0, 0},
  {&__pyx_n_s_StringValue, __pyx_k_StringValue, sizeof(__pyx_k_StringValue), 0, 0, 1, 1},
  {&__pyx_n_s_StructArray, __pyx_k_StructArray, sizeof(__pyx_k_StructArray), 0, 0, 1, 1},
  {&__pyx_n_s_StructType, __pyx_k_StructType, sizeof(__pyx_k_StructType), 0, 0, 1, 1},
  {&__pyx_n_s_StructType___iter, __pyx_k_StructType___iter, sizeof(__pyx_k_StructType___iter), 0, 0, 1, 1},
  {&__pyx_n_s_StructValue, __pyx_k_StructValue, sizeof(__pyx_k_StructValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Struct_field_name_corresponds_to, __pyx_k_Struct_field_name_corresponds_to, sizeof(__pyx_k_Struct_field_name_corresponds_to), 0, 1, 0, 0},
  {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1},
  {&__pyx_n_s_Table, __pyx_k_Table, sizeof(__pyx_k_Table), 0, 0, 1, 1},
  {&__pyx_kp_u_Table_from_pandas_line_998, __pyx_k_Table_from_pandas_line_998, sizeof(__pyx_k_Table_from_pandas_line_998), 0, 1, 0, 0},
  {&__pyx_n_s_Table_itercolumns, __pyx_k_Table_itercolumns, sizeof(__pyx_k_Table_itercolumns), 0, 0, 1, 1},
  {&__pyx_kp_u_Take_elements_from_an_array_The, __pyx_k_Take_elements_from_an_array_The, sizeof(__pyx_k_Take_elements_from_an_array_The), 0, 1, 0, 0},
  {&__pyx_kp_u_Target_schema_s_field_names_are, __pyx_k_Target_schema_s_field_names_are, sizeof(__pyx_k_Target_schema_s_field_names_are), 0, 1, 0, 0},
  {&__pyx_n_s_Tensor, __pyx_k_Tensor, sizeof(__pyx_k_Tensor), 0, 0, 1, 1},
  {&__pyx_kp_u_Tensor_was_NULL, __pyx_k_Tensor_was_NULL, sizeof(__pyx_k_Tensor_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_TextIOBase, __pyx_k_TextIOBase, sizeof(__pyx_k_TextIOBase), 0, 0, 1, 1},
  {&__pyx_kp_u_The_add_metadata_method_is_depre, __pyx_k_The_add_metadata_method_is_depre, sizeof(__pyx_k_The_add_metadata_method_is_depre), 0, 1, 0, 0},
  {&__pyx_kp_u_The_dictionary_index_type_should, __pyx_k_The_dictionary_index_type_should, sizeof(__pyx_k_The_dictionary_index_type_should), 0, 1, 0, 0},
  {&__pyx_kp_u_The_field_by_name_method_is_depr, __pyx_k_The_field_by_name_method_is_depr, sizeof(__pyx_k_The_field_by_name_method_is_depr), 0, 1, 0, 0},
  {&__pyx_kp_u_The_names_and_metadata_arguments, __pyx_k_The_names_and_metadata_arguments, sizeof(__pyx_k_The_names_and_metadata_arguments), 0, 1, 0, 0},
  {&__pyx_kp_u_The_names_argument_is_not_valid, __pyx_k_The_names_argument_is_not_valid, sizeof(__pyx_k_The_names_argument_is_not_valid), 0, 1, 0, 0},
  {&__pyx_kp_u_The_object_s___arrow_array___met, __pyx_k_The_object_s___arrow_array___met, sizeof(__pyx_k_The_object_s___arrow_array___met), 0, 1, 0, 0},
  {&__pyx_kp_u_The_parameter_chunksize_is_depre, __pyx_k_The_parameter_chunksize_is_depre, sizeof(__pyx_k_The_parameter_chunksize_is_depre), 0, 1, 0, 0},
  {&__pyx_kp_u_The_parameter_chunksize_is_depre_2, __pyx_k_The_parameter_chunksize_is_depre_2, sizeof(__pyx_k_The_parameter_chunksize_is_depre_2), 0, 1, 0, 0},
  {&__pyx_kp_u_The_type_id_argument_must_be_a_s, __pyx_k_The_type_id_argument_must_be_a_s, sizeof(__pyx_k_The_type_id_argument_must_be_a_s), 0, 1, 0, 0},
  {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Array, __pyx_k_Time32Array, sizeof(__pyx_k_Time32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Type, __pyx_k_Time32Type, sizeof(__pyx_k_Time32Type), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Value, __pyx_k_Time32Value, sizeof(__pyx_k_Time32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Array, __pyx_k_Time64Array, sizeof(__pyx_k_Time64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Type, __pyx_k_Time64Type, sizeof(__pyx_k_Time64Type), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Value, __pyx_k_Time64Value, sizeof(__pyx_k_Time64Value), 0, 0, 1, 1},
  {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1},
  {&__pyx_n_s_TimestampArray, __pyx_k_TimestampArray, sizeof(__pyx_k_TimestampArray), 0, 0, 1, 1},
  {&__pyx_n_s_TimestampType, __pyx_k_TimestampType, sizeof(__pyx_k_TimestampType), 0, 0, 1, 1},
  {&__pyx_n_s_TimestampValue, __pyx_k_TimestampValue, sizeof(__pyx_k_TimestampValue), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_Type_BINARY, __pyx_k_Type_BINARY, sizeof(__pyx_k_Type_BINARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_BOOL, __pyx_k_Type_BOOL, sizeof(__pyx_k_Type_BOOL), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DATE32, __pyx_k_Type_DATE32, sizeof(__pyx_k_Type_DATE32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DATE64, __pyx_k_Type_DATE64, sizeof(__pyx_k_Type_DATE64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DECIMAL, __pyx_k_Type_DECIMAL, sizeof(__pyx_k_Type_DECIMAL), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DICTIONARY, __pyx_k_Type_DICTIONARY, sizeof(__pyx_k_Type_DICTIONARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DOUBLE, __pyx_k_Type_DOUBLE, sizeof(__pyx_k_Type_DOUBLE), 0, 0, 1, 1},
  {&__pyx_n_s_Type_FIXED_SIZE_BINARY, __pyx_k_Type_FIXED_SIZE_BINARY, sizeof(__pyx_k_Type_FIXED_SIZE_BINARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_FLOAT, __pyx_k_Type_FLOAT, sizeof(__pyx_k_Type_FLOAT), 0, 0, 1, 1},
  {&__pyx_n_s_Type_HALF_FLOAT, __pyx_k_Type_HALF_FLOAT, sizeof(__pyx_k_Type_HALF_FLOAT), 0, 0, 1, 1},
  {&__pyx_kp_u_Type_ID, __pyx_k_Type_ID, sizeof(__pyx_k_Type_ID), 0, 1, 0, 0},
  {&__pyx_n_s_Type_INT16, __pyx_k_Type_INT16, sizeof(__pyx_k_Type_INT16), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT32, __pyx_k_Type_INT32, sizeof(__pyx_k_Type_INT32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT64, __pyx_k_Type_INT64, sizeof(__pyx_k_Type_INT64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT8, __pyx_k_Type_INT8, sizeof(__pyx_k_Type_INT8), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LARGE_BINARY, __pyx_k_Type_LARGE_BINARY, sizeof(__pyx_k_Type_LARGE_BINARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LARGE_LIST, __pyx_k_Type_LARGE_LIST, sizeof(__pyx_k_Type_LARGE_LIST), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LARGE_STRING, __pyx_k_Type_LARGE_STRING, sizeof(__pyx_k_Type_LARGE_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LIST, __pyx_k_Type_LIST, sizeof(__pyx_k_Type_LIST), 0, 0, 1, 1},
  {&__pyx_n_s_Type_MAP, __pyx_k_Type_MAP, sizeof(__pyx_k_Type_MAP), 0, 0, 1, 1},
  {&__pyx_n_s_Type_NA, __pyx_k_Type_NA, sizeof(__pyx_k_Type_NA), 0, 0, 1, 1},
  {&__pyx_n_s_Type_STRING, __pyx_k_Type_STRING, sizeof(__pyx_k_Type_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_Type_STRUCT, __pyx_k_Type_STRUCT, sizeof(__pyx_k_Type_STRUCT), 0, 0, 1, 1},
  {&__pyx_n_s_Type_TIME32, __pyx_k_Type_TIME32, sizeof(__pyx_k_Type_TIME32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_TIME64, __pyx_k_Type_TIME64, sizeof(__pyx_k_Type_TIME64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_TIMESTAMP, __pyx_k_Type_TIMESTAMP, sizeof(__pyx_k_Type_TIMESTAMP), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT16, __pyx_k_Type_UINT16, sizeof(__pyx_k_Type_UINT16), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT32, __pyx_k_Type_UINT32, sizeof(__pyx_k_Type_UINT32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT64, __pyx_k_Type_UINT64, sizeof(__pyx_k_Type_UINT64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT8, __pyx_k_Type_UINT8, sizeof(__pyx_k_Type_UINT8), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UNION, __pyx_k_Type_UNION, sizeof(__pyx_k_Type_UNION), 0, 0, 1, 1},
  {&__pyx_kp_u_Type_s_expected_number_of_buffer, __pyx_k_Type_s_expected_number_of_buffer, sizeof(__pyx_k_Type_s_expected_number_of_buffer), 0, 1, 0, 0},
  {&__pyx_kp_u_Type_s_expected_number_of_childr, __pyx_k_Type_s_expected_number_of_childr, sizeof(__pyx_k_Type_s_expected_number_of_childr), 0, 1, 0, 0},
  {&__pyx_n_s_UInt16Array, __pyx_k_UInt16Array, sizeof(__pyx_k_UInt16Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt16Scalar, __pyx_k_UInt16Scalar, sizeof(__pyx_k_UInt16Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt16Value, __pyx_k_UInt16Value, sizeof(__pyx_k_UInt16Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Array, __pyx_k_UInt32Array, sizeof(__pyx_k_UInt32Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Scalar, __pyx_k_UInt32Scalar, sizeof(__pyx_k_UInt32Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Value, __pyx_k_UInt32Value, sizeof(__pyx_k_UInt32Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Array, __pyx_k_UInt64Array, sizeof(__pyx_k_UInt64Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Scalar, __pyx_k_UInt64Scalar, sizeof(__pyx_k_UInt64Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Value, __pyx_k_UInt64Value, sizeof(__pyx_k_UInt64Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Array, __pyx_k_UInt8Array, sizeof(__pyx_k_UInt8Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Scalar, __pyx_k_UInt8Scalar, sizeof(__pyx_k_UInt8Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Value, __pyx_k_UInt8Value, sizeof(__pyx_k_UInt8Value), 0, 0, 1, 1},
  {&__pyx_kp_u_Unable_to_convert_timezone_to_st, __pyx_k_Unable_to_convert_timezone_to_st, sizeof(__pyx_k_Unable_to_convert_timezone_to_st), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_read_from_object_of_ty, __pyx_k_Unable_to_read_from_object_of_ty, sizeof(__pyx_k_Unable_to_read_from_object_of_ty), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_read_message_from_obje, __pyx_k_Unable_to_read_message_from_obje, sizeof(__pyx_k_Unable_to_read_message_from_obje), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_wrap_Datum_in_a_Python, __pyx_k_Unable_to_wrap_Datum_in_a_Python, sizeof(__pyx_k_Unable_to_wrap_Datum_in_a_Python), 0, 1, 0, 0},
  {&__pyx_n_s_UnionArray, __pyx_k_UnionArray, sizeof(__pyx_k_UnionArray), 0, 0, 1, 1},
  {&__pyx_n_s_UnionMode_DENSE, __pyx_k_UnionMode_DENSE, sizeof(__pyx_k_UnionMode_DENSE), 0, 0, 1, 1},
  {&__pyx_n_s_UnionMode_SPARSE, __pyx_k_UnionMode_SPARSE, sizeof(__pyx_k_UnionMode_SPARSE), 0, 0, 1, 1},
  {&__pyx_n_s_UnionType, __pyx_k_UnionType, sizeof(__pyx_k_UnionType), 0, 0, 1, 1},
  {&__pyx_n_s_UnionType___iter, __pyx_k_UnionType___iter, sizeof(__pyx_k_UnionType___iter), 0, 0, 1, 1},
  {&__pyx_n_s_UnionValue, __pyx_k_UnionValue, sizeof(__pyx_k_UnionValue), 0, 0, 1, 1},
  {&__pyx_n_s_UnknownExtensionType, __pyx_k_UnknownExtensionType, sizeof(__pyx_k_UnknownExtensionType), 0, 0, 1, 1},
  {&__pyx_kp_u_Unrecognized_compression_type, __pyx_k_Unrecognized_compression_type, sizeof(__pyx_k_Unrecognized_compression_type), 0, 1, 0, 0},
  {&__pyx_n_s_UnsupportedOperation, __pyx_k_UnsupportedOperation, sizeof(__pyx_k_UnsupportedOperation), 0, 0, 1, 1},
  {&__pyx_n_s_UserWarning, __pyx_k_UserWarning, sizeof(__pyx_k_UserWarning), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_u_We_do_not_know_how_to_serialize, __pyx_k_We_do_not_know_how_to_serialize, sizeof(__pyx_k_We_do_not_know_how_to_serialize), 0, 1, 0, 0},
  {&__pyx_kp_u_Writable_buffer_requested_but_Ar, __pyx_k_Writable_buffer_requested_but_Ar, sizeof(__pyx_k_Writable_buffer_requested_but_Ar), 0, 1, 0, 0},
  {&__pyx_kp_b__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 0, 0},
  {&__pyx_kp_b__181, __pyx_k__181, sizeof(__pyx_k__181), 0, 0, 0, 0},
  {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1},
  {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0},
  {&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0},
  {&__pyx_n_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 1},
  {&__pyx_n_u_ab, __pyx_k_ab, sizeof(__pyx_k_ab), 0, 1, 0, 1},
  {&__pyx_kp_u_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 1, 0, 0},
  {&__pyx_n_s_ad, __pyx_k_ad, sizeof(__pyx_k_ad), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_column, __pyx_k_add_column, sizeof(__pyx_k_add_column), 0, 0, 1, 1},
  {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1},
  {&__pyx_n_s_alias, __pyx_k_alias, sizeof(__pyx_k_alias), 0, 0, 1, 1},
  {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1},
  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_api, __pyx_k_api, sizeof(__pyx_k_api), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arg_dict_memo, __pyx_k_arg_dict_memo, sizeof(__pyx_k_arg_dict_memo), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_array_data, __pyx_k_array_data, sizeof(__pyx_k_array_data), 0, 0, 1, 1},
  {&__pyx_kp_u_array_line_99, __pyx_k_array_line_99, sizeof(__pyx_k_array_line_99), 0, 1, 0, 0},
  {&__pyx_n_s_arrays, __pyx_k_arrays, sizeof(__pyx_k_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_array, __pyx_k_arrow_array, sizeof(__pyx_k_arrow_array), 0, 0, 1, 1},
  {&__pyx_n_u_arrow_array, __pyx_k_arrow_array, sizeof(__pyx_k_arrow_array), 0, 1, 0, 1},
  {&__pyx_n_s_arrow_ext_deserialize, __pyx_k_arrow_ext_deserialize, sizeof(__pyx_k_arrow_ext_deserialize), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_obj, __pyx_k_arrow_obj, sizeof(__pyx_k_arrow_obj), 0, 0, 1, 1},
  {&__pyx_kp_u_arrow_py_extension_type, __pyx_k_arrow_py_extension_type, sizeof(__pyx_k_arrow_py_extension_type), 0, 1, 0, 0},
  {&__pyx_n_s_as_buffer, __pyx_k_as_buffer, sizeof(__pyx_k_as_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_as_py, __pyx_k_as_py, sizeof(__pyx_k_as_py), 0, 0, 1, 1},
  {&__pyx_n_u_as_py, __pyx_k_as_py, sizeof(__pyx_k_as_py), 0, 1, 0, 1},
  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
  {&__pyx_n_s_asbytes, __pyx_k_asbytes, sizeof(__pyx_k_asbytes), 0, 0, 1, 1},
  {&__pyx_n_s_assert_frame_equal, __pyx_k_assert_frame_equal, sizeof(__pyx_k_assert_frame_equal), 0, 0, 1, 1},
  {&__pyx_n_s_assert_open, __pyx_k_assert_open, sizeof(__pyx_k_assert_open), 0, 0, 1, 1},
  {&__pyx_n_s_assert_readable, __pyx_k_assert_readable, sizeof(__pyx_k_assert_readable), 0, 0, 1, 1},
  {&__pyx_n_s_assert_seekable, __pyx_k_assert_seekable, sizeof(__pyx_k_assert_seekable), 0, 0, 1, 1},
  {&__pyx_n_s_assert_writable, __pyx_k_assert_writable, sizeof(__pyx_k_assert_writable), 0, 0, 1, 1},
  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
  {&__pyx_n_s_atexit, __pyx_k_atexit, sizeof(__pyx_k_atexit), 0, 0, 1, 1},
  {&__pyx_n_b_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 0, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_b_bBhHiIqQ, __pyx_k_bBhHiIqQ, sizeof(__pyx_k_bBhHiIqQ), 0, 0, 0, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1},
  {&__pyx_n_s_batch, __pyx_k_batch, sizeof(__pyx_k_batch), 0, 0, 1, 1},
  {&__pyx_n_s_batches, __pyx_k_batches, sizeof(__pyx_k_batches), 0, 0, 1, 1},
  {&__pyx_n_s_benchmark_PandasObjectIsNull, __pyx_k_benchmark_PandasObjectIsNull, sizeof(__pyx_k_benchmark_PandasObjectIsNull), 0, 0, 1, 1},
  {&__pyx_n_s_bg_write, __pyx_k_bg_write, sizeof(__pyx_k_bg_write), 0, 0, 1, 1},
  {&__pyx_n_s_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 0, 1, 1},
  {&__pyx_n_u_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 1, 0, 1},
  {&__pyx_kp_u_binary_file_expected_got_text_fi, __pyx_k_binary_file_expected_got_text_fi, sizeof(__pyx_k_binary_file_expected_got_text_fi), 0, 1, 0, 0},
  {&__pyx_n_s_binary_type, __pyx_k_binary_type, sizeof(__pyx_k_binary_type), 0, 0, 1, 1},
  {&__pyx_n_s_bit_width, __pyx_k_bit_width, sizeof(__pyx_k_bit_width), 0, 0, 1, 1},
  {&__pyx_n_u_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 1, 0, 1},
  {&__pyx_n_s_body, __pyx_k_body, sizeof(__pyx_k_body), 0, 0, 1, 1},
  {&__pyx_n_s_body_length, __pyx_k_body_length, sizeof(__pyx_k_body_length), 0, 0, 1, 1},
  {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
  {&__pyx_n_u_bool_2, __pyx_k_bool_2, sizeof(__pyx_k_bool_2), 0, 1, 0, 1},
  {&__pyx_n_u_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 1, 0, 1},
  {&__pyx_n_u_brotli, __pyx_k_brotli, sizeof(__pyx_k_brotli), 0, 1, 0, 1},
  {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_buffer_size, __pyx_k_buffer_size, sizeof(__pyx_k_buffer_size), 0, 0, 1, 1},
  {&__pyx_n_s_buffers, __pyx_k_buffers, sizeof(__pyx_k_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_builtin_pickle, __pyx_k_builtin_pickle, sizeof(__pyx_k_builtin_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_byte_width, __pyx_k_byte_width, sizeof(__pyx_k_byte_width), 0, 0, 1, 1},
  {&__pyx_n_u_bz2, __pyx_k_bz2, sizeof(__pyx_k_bz2), 0, 1, 0, 1},
  {&__pyx_kp_u_bz2_2, __pyx_k_bz2_2, sizeof(__pyx_k_bz2_2), 0, 1, 0, 0},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_c_addr, __pyx_k_c_addr, sizeof(__pyx_k_c_addr), 0, 0, 1, 1},
  {&__pyx_n_s_c_array, __pyx_k_c_array, sizeof(__pyx_k_c_array), 0, 0, 1, 1},
  {&__pyx_n_s_c_arrays, __pyx_k_c_arrays, sizeof(__pyx_k_c_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_c_batches, __pyx_k_c_batches, sizeof(__pyx_k_c_batches), 0, 0, 1, 1},
  {&__pyx_n_s_c_buf, __pyx_k_c_buf, sizeof(__pyx_k_c_buf), 0, 0, 1, 1},
  {&__pyx_n_s_c_buffers, __pyx_k_c_buffers, sizeof(__pyx_k_c_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_c_child_data, __pyx_k_c_child_data, sizeof(__pyx_k_c_child_data), 0, 0, 1, 1},
  {&__pyx_n_s_c_codec, __pyx_k_c_codec, sizeof(__pyx_k_c_codec), 0, 0, 1, 1},
  {&__pyx_n_s_c_dim_names, __pyx_k_c_dim_names, sizeof(__pyx_k_c_dim_names), 0, 0, 1, 1},
  {&__pyx_n_s_c_extension_name, __pyx_k_c_extension_name, sizeof(__pyx_k_c_extension_name), 0, 0, 1, 1},
  {&__pyx_n_s_c_field_names, __pyx_k_c_field_names, sizeof(__pyx_k_c_field_names), 0, 0, 1, 1},
  {&__pyx_n_s_c_fields, __pyx_k_c_fields, sizeof(__pyx_k_c_fields), 0, 0, 1, 1},
  {&__pyx_n_s_c_from_pandas, __pyx_k_c_from_pandas, sizeof(__pyx_k_c_from_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_c_meta, __pyx_k_c_meta, sizeof(__pyx_k_c_meta), 0, 0, 1, 1},
  {&__pyx_n_s_c_names, __pyx_k_c_names, sizeof(__pyx_k_c_names), 0, 0, 1, 1},
  {&__pyx_n_s_c_options, __pyx_k_c_options, sizeof(__pyx_k_c_options), 0, 0, 1, 1},
  {&__pyx_n_s_c_ordered, __pyx_k_c_ordered, sizeof(__pyx_k_c_ordered), 0, 0, 1, 1},
  {&__pyx_n_s_c_path, __pyx_k_c_path, sizeof(__pyx_k_c_path), 0, 0, 1, 1},
  {&__pyx_n_s_c_result, __pyx_k_c_result, sizeof(__pyx_k_c_result), 0, 0, 1, 1},
  {&__pyx_n_s_c_schema, __pyx_k_c_schema, sizeof(__pyx_k_c_schema), 0, 0, 1, 1},
  {&__pyx_n_s_c_shape, __pyx_k_c_shape, sizeof(__pyx_k_c_shape), 0, 0, 1, 1},
  {&__pyx_n_s_c_size, __pyx_k_c_size, sizeof(__pyx_k_c_size), 0, 0, 1, 1},
  {&__pyx_n_s_c_stream, __pyx_k_c_stream, sizeof(__pyx_k_c_stream), 0, 0, 1, 1},
  {&__pyx_n_s_c_table, __pyx_k_c_table, sizeof(__pyx_k_c_table), 0, 0, 1, 1},
  {&__pyx_n_s_c_tables, __pyx_k_c_tables, sizeof(__pyx_k_c_tables), 0, 0, 1, 1},
  {&__pyx_n_s_c_timezone, __pyx_k_c_timezone, sizeof(__pyx_k_c_timezone), 0, 0, 1, 1},
  {&__pyx_n_s_c_type, __pyx_k_c_type, sizeof(__pyx_k_c_type), 0, 0, 1, 1},
  {&__pyx_n_s_c_type_codes, __pyx_k_c_type_codes, sizeof(__pyx_k_c_type_codes), 0, 0, 1, 1},
  {&__pyx_n_s_c_type_name, __pyx_k_c_type_name, sizeof(__pyx_k_c_type_name), 0, 0, 1, 1},
  {&__pyx_n_s_cast, __pyx_k_cast, sizeof(__pyx_k_cast), 0, 0, 1, 1},
  {&__pyx_n_s_cat, __pyx_k_cat, sizeof(__pyx_k_cat), 0, 0, 1, 1},
  {&__pyx_n_s_categorical_columns, __pyx_k_categorical_columns, sizeof(__pyx_k_categorical_columns), 0, 0, 1, 1},
  {&__pyx_n_s_categorical_type, __pyx_k_categorical_type, sizeof(__pyx_k_categorical_type), 0, 0, 1, 1},
  {&__pyx_n_s_categories, __pyx_k_categories, sizeof(__pyx_k_categories), 0, 0, 1, 1},
  {&__pyx_n_s_check_metadata, __pyx_k_check_metadata, sizeof(__pyx_k_check_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1},
  {&__pyx_n_s_child_field, __pyx_k_child_field, sizeof(__pyx_k_child_field), 0, 0, 1, 1},
  {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1},
  {&__pyx_n_s_children_fields, __pyx_k_children_fields, sizeof(__pyx_k_children_fields), 0, 0, 1, 1},
  {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1},
  {&__pyx_n_s_chunked_array, __pyx_k_chunked_array, sizeof(__pyx_k_chunked_array), 0, 0, 1, 1},
  {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1},
  {&__pyx_n_u_chunksize, __pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 1, 0, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cleanup, __pyx_k_cleanup, sizeof(__pyx_k_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_client, __pyx_k_client, sizeof(__pyx_k_client), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_u_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 1, 0, 1},
  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
  {&__pyx_n_u_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 1, 0, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_codec, __pyx_k_codec, sizeof(__pyx_k_codec), 0, 0, 1, 1},
  {&__pyx_n_s_codes, __pyx_k_codes, sizeof(__pyx_k_codes), 0, 0, 1, 1},
  {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1},
  {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1},
  {&__pyx_n_s_column_2, __pyx_k_column_2, sizeof(__pyx_k_column_2), 0, 0, 1, 1},
  {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1},
  {&__pyx_n_s_common, __pyx_k_common, sizeof(__pyx_k_common), 0, 0, 1, 1},
  {&__pyx_n_s_compat, __pyx_k_compat, sizeof(__pyx_k_compat), 0, 0, 1, 1},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1},
  {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1},
  {&__pyx_n_s_compressor, __pyx_k_compressor, sizeof(__pyx_k_compressor), 0, 0, 1, 1},
  {&__pyx_n_s_concat_arrays, __pyx_k_concat_arrays, sizeof(__pyx_k_concat_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_concat_tables, __pyx_k_concat_tables, sizeof(__pyx_k_concat_tables), 0, 0, 1, 1},
  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
  {&__pyx_n_s_converted_arrays, __pyx_k_converted_arrays, sizeof(__pyx_k_converted_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1},
  {&__pyx_kp_u_could_not_infer_open_mode_for_fi, __pyx_k_could_not_infer_open_mode_for_fi, sizeof(__pyx_k_could_not_infer_open_mode_for_fi), 0, 1, 0, 0},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_cpool, __pyx_k_cpool, sizeof(__pyx_k_cpool), 0, 0, 1, 1},
  {&__pyx_n_s_cpp_file, __pyx_k_cpp_file, sizeof(__pyx_k_cpp_file), 0, 0, 1, 1},
  {&__pyx_n_s_cpu_count, __pyx_k_cpu_count, sizeof(__pyx_k_cpu_count), 0, 0, 1, 1},
  {&__pyx_n_s_cpy_ext_type, __pyx_k_cpy_ext_type, sizeof(__pyx_k_cpy_ext_type), 0, 0, 1, 1},
  {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
  {&__pyx_n_s_create_memory_map, __pyx_k_create_memory_map, sizeof(__pyx_k_create_memory_map), 0, 0, 1, 1},
  {&__pyx_n_s_csparse_tensor, __pyx_k_csparse_tensor, sizeof(__pyx_k_csparse_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_ctensor, __pyx_k_ctensor, sizeof(__pyx_k_ctensor), 0, 0, 1, 1},
  {&__pyx_n_s_custom_deserializer, __pyx_k_custom_deserializer, sizeof(__pyx_k_custom_deserializer), 0, 0, 1, 1},
  {&__pyx_n_s_custom_serializer, __pyx_k_custom_serializer, sizeof(__pyx_k_custom_serializer), 0, 0, 1, 1},
  {&__pyx_n_b_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 0, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1},
  {&__pyx_n_s_data_frame, __pyx_k_data_frame, sizeof(__pyx_k_data_frame), 0, 0, 1, 1},
  {&__pyx_n_s_dataframe_to_arrays, __pyx_k_dataframe_to_arrays, sizeof(__pyx_k_dataframe_to_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_dataframe_to_types, __pyx_k_dataframe_to_types, sizeof(__pyx_k_dataframe_to_types), 0, 0, 1, 1},
  {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {&__pyx_n_s_date32, __pyx_k_date32, sizeof(__pyx_k_date32), 0, 0, 1, 1},
  {&__pyx_n_u_date32, __pyx_k_date32, sizeof(__pyx_k_date32), 0, 1, 0, 1},
  {&__pyx_kp_u_date32_day, __pyx_k_date32_day, sizeof(__pyx_k_date32_day), 0, 1, 0, 0},
  {&__pyx_n_s_date64, __pyx_k_date64, sizeof(__pyx_k_date64), 0, 0, 1, 1},
  {&__pyx_n_u_date64, __pyx_k_date64, sizeof(__pyx_k_date64), 0, 1, 0, 1},
  {&__pyx_kp_u_date64_ms, __pyx_k_date64_ms, sizeof(__pyx_k_date64_ms), 0, 1, 0, 0},
  {&__pyx_n_s_date_as_object, __pyx_k_date_as_object, sizeof(__pyx_k_date_as_object), 0, 0, 1, 1},
  {&__pyx_n_u_date_as_object, __pyx_k_date_as_object, sizeof(__pyx_k_date_as_object), 0, 1, 0, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_kp_u_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 1, 0, 0},
  {&__pyx_n_s_datetime_conversion_functions, __pyx_k_datetime_conversion_functions, sizeof(__pyx_k_datetime_conversion_functions), 0, 0, 1, 1},
  {&__pyx_n_s_datetime_conversion_functions_l, __pyx_k_datetime_conversion_functions_l, sizeof(__pyx_k_datetime_conversion_functions_l), 0, 0, 1, 1},
  {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
  {&__pyx_n_s_decay_ms, __pyx_k_decay_ms, sizeof(__pyx_k_decay_ms), 0, 0, 1, 1},
  {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1},
  {&__pyx_n_s_decimal128, __pyx_k_decimal128, sizeof(__pyx_k_decimal128), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decompress, __pyx_k_decompress, sizeof(__pyx_k_decompress), 0, 0, 1, 1},
  {&__pyx_n_s_decompressed_size, __pyx_k_decompressed_size, sizeof(__pyx_k_decompressed_size), 0, 0, 1, 1},
  {&__pyx_n_s_deduplicate_objects, __pyx_k_deduplicate_objects, sizeof(__pyx_k_deduplicate_objects), 0, 0, 1, 1},
  {&__pyx_n_u_deduplicate_objects, __pyx_k_deduplicate_objects, sizeof(__pyx_k_deduplicate_objects), 0, 1, 0, 1},
  {&__pyx_n_s_default_block_size, __pyx_k_default_block_size, sizeof(__pyx_k_default_block_size), 0, 0, 1, 1},
  {&__pyx_n_s_default_context_initialized, __pyx_k_default_context_initialized, sizeof(__pyx_k_default_context_initialized), 0, 0, 1, 1},
  {&__pyx_n_s_default_memory_pool, __pyx_k_default_memory_pool, sizeof(__pyx_k_default_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_default_serialization_context, __pyx_k_default_serialization_context, sizeof(__pyx_k_default_serialization_context), 0, 0, 1, 1},
  {&__pyx_n_u_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 1, 0, 1},
  {&__pyx_n_s_deserialize, __pyx_k_deserialize, sizeof(__pyx_k_deserialize), 0, 0, 1, 1},
  {&__pyx_n_s_deserialize_components, __pyx_k_deserialize_components, sizeof(__pyx_k_deserialize_components), 0, 0, 1, 1},
  {&__pyx_n_s_deserialize_from, __pyx_k_deserialize_from, sizeof(__pyx_k_deserialize_from), 0, 0, 1, 1},
  {&__pyx_n_s_deserializer, __pyx_k_deserializer, sizeof(__pyx_k_deserializer), 0, 0, 1, 1},
  {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
  {&__pyx_n_u_detect, __pyx_k_detect, sizeof(__pyx_k_detect), 0, 1, 0, 1},
  {&__pyx_n_s_detect_compression, __pyx_k_detect_compression, sizeof(__pyx_k_detect_compression), 0, 0, 1, 1},
  {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_u_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 0, 1},
  {&__pyx_n_s_dictionary, __pyx_k_dictionary, sizeof(__pyx_k_dictionary), 0, 0, 1, 1},
  {&__pyx_n_u_dictionary, __pyx_k_dictionary, sizeof(__pyx_k_dictionary), 0, 1, 0, 1},
  {&__pyx_n_s_dictionary_2, __pyx_k_dictionary_2, sizeof(__pyx_k_dictionary_2), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary_memo, __pyx_k_dictionary_memo, sizeof(__pyx_k_dictionary_memo), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary_value, __pyx_k_dictionary_value, sizeof(__pyx_k_dictionary_value), 0, 0, 1, 1},
  {&__pyx_n_s_dim_names, __pyx_k_dim_names, sizeof(__pyx_k_dim_names), 0, 0, 1, 1},
  {&__pyx_n_u_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 1, 0, 1},
  {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_u_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 1, 0, 1},
  {&__pyx_n_s_download, __pyx_k_download, sizeof(__pyx_k_download), 0, 0, 1, 1},
  {&__pyx_n_s_download_locals_bg_write, __pyx_k_download_locals_bg_write, sizeof(__pyx_k_download_locals_bg_write), 0, 0, 1, 1},
  {&__pyx_n_s_download_locals_cleanup, __pyx_k_download_locals_cleanup, sizeof(__pyx_k_download_locals_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1},
  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_b_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 0, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_e2, __pyx_k_e2, sizeof(__pyx_k_e2), 0, 0, 1, 1},
  {&__pyx_n_s_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 0, 1, 1},
  {&__pyx_n_s_encode_file_path, __pyx_k_encode_file_path, sizeof(__pyx_k_encode_file_path), 0, 0, 1, 1},
  {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_equals, __pyx_k_equals, sizeof(__pyx_k_equals), 0, 0, 1, 1},
  {&__pyx_n_s_example_object, __pyx_k_example_object, sizeof(__pyx_k_example_object), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_exc_tb, __pyx_k_exc_tb, sizeof(__pyx_k_exc_tb), 0, 0, 1, 1},
  {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1},
  {&__pyx_n_s_exc_val, __pyx_k_exc_val, sizeof(__pyx_k_exc_val), 0, 0, 1, 1},
  {&__pyx_n_s_exc_value, __pyx_k_exc_value, sizeof(__pyx_k_exc_value), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_ext_array, __pyx_k_ext_array, sizeof(__pyx_k_ext_array), 0, 0, 1, 1},
  {&__pyx_n_s_ext_type, __pyx_k_ext_type, sizeof(__pyx_k_ext_type), 0, 0, 1, 1},
  {&__pyx_n_s_extension_name, __pyx_k_extension_name, sizeof(__pyx_k_extension_name), 0, 0, 1, 1},
  {&__pyx_n_s_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 0, 0, 1, 1},
  {&__pyx_n_s_extra_conf, __pyx_k_extra_conf, sizeof(__pyx_k_extra_conf), 0, 0, 1, 1},
  {&__pyx_n_b_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 0, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_u_f2, __pyx_k_f2, sizeof(__pyx_k_f2), 0, 1, 0, 1},
  {&__pyx_n_u_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 1, 0, 1},
  {&__pyx_n_u_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 1, 0, 1},
  {&__pyx_n_s_fastpath, __pyx_k_fastpath, sizeof(__pyx_k_fastpath), 0, 0, 1, 1},
  {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1},
  {&__pyx_n_s_field_2, __pyx_k_field_2, sizeof(__pyx_k_field_2), 0, 0, 1, 1},
  {&__pyx_n_s_field_3, __pyx_k_field_3, sizeof(__pyx_k_field_3), 0, 0, 1, 1},
  {&__pyx_n_s_field_names, __pyx_k_field_names, sizeof(__pyx_k_field_names), 0, 0, 1, 1},
  {&__pyx_kp_u_field_or_tuple_expected_got_None, __pyx_k_field_or_tuple_expected_got_None, sizeof(__pyx_k_field_or_tuple_expected_got_None), 0, 1, 0, 0},
  {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
  {&__pyx_n_u_fields_2, __pyx_k_fields_2, sizeof(__pyx_k_fields_2), 0, 1, 0, 1},
  {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1},
  {&__pyx_n_s_file_descriptor, __pyx_k_file_descriptor, sizeof(__pyx_k_file_descriptor), 0, 0, 1, 1},
  {&__pyx_n_s_file_handle, __pyx_k_file_handle, sizeof(__pyx_k_file_handle), 0, 0, 1, 1},
  {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1},
  {&__pyx_n_s_fixed_offset_to_string, __pyx_k_fixed_offset_to_string, sizeof(__pyx_k_fixed_offset_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_fixed_size_binary_type, __pyx_k_fixed_size_binary_type, sizeof(__pyx_k_fixed_size_binary_type), 0, 0, 1, 1},
  {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
  {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
  {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1},
  {&__pyx_n_u_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 1, 0, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_u_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 1, 0, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_u_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 1, 0, 1},
  {&__pyx_n_s_footer_offset, __pyx_k_footer_offset, sizeof(__pyx_k_footer_offset), 0, 0, 1, 1},
  {&__pyx_n_s_foreign_buffer, __pyx_k_foreign_buffer, sizeof(__pyx_k_foreign_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_from_arrays, __pyx_k_from_arrays, sizeof(__pyx_k_from_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_from_batches, __pyx_k_from_batches, sizeof(__pyx_k_from_batches), 0, 0, 1, 1},
  {&__pyx_n_s_from_buffers, __pyx_k_from_buffers, sizeof(__pyx_k_from_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_from_components, __pyx_k_from_components, sizeof(__pyx_k_from_components), 0, 0, 1, 1},
  {&__pyx_n_s_from_dense, __pyx_k_from_dense, sizeof(__pyx_k_from_dense), 0, 0, 1, 1},
  {&__pyx_n_s_from_dense_numpy, __pyx_k_from_dense_numpy, sizeof(__pyx_k_from_dense_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_from_numpy, __pyx_k_from_numpy, sizeof(__pyx_k_from_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_from_numpy_dtype, __pyx_k_from_numpy_dtype, sizeof(__pyx_k_from_numpy_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_from_pandas, __pyx_k_from_pandas, sizeof(__pyx_k_from_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_from_pydict, __pyx_k_from_pydict, sizeof(__pyx_k_from_pydict), 0, 0, 1, 1},
  {&__pyx_n_s_from_sparse, __pyx_k_from_sparse, sizeof(__pyx_k_from_sparse), 0, 0, 1, 1},
  {&__pyx_n_s_from_storage, __pyx_k_from_storage, sizeof(__pyx_k_from_storage), 0, 0, 1, 1},
  {&__pyx_n_s_from_tensor, __pyx_k_from_tensor, sizeof(__pyx_k_from_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_frombuffer, __pyx_k_frombuffer, sizeof(__pyx_k_frombuffer), 0, 0, 1, 1},
  {&__pyx_n_s_frombytes, __pyx_k_frombytes, sizeof(__pyx_k_frombytes), 0, 0, 1, 1},
  {&__pyx_n_s_fromutc, __pyx_k_fromutc, sizeof(__pyx_k_fromutc), 0, 0, 1, 1},
  {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
  {&__pyx_n_s_full_info, __pyx_k_full_info, sizeof(__pyx_k_full_info), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_batch, __pyx_k_get_batch, sizeof(__pyx_k_get_batch), 0, 0, 1, 1},
  {&__pyx_n_s_get_capacity, __pyx_k_get_capacity, sizeof(__pyx_k_get_capacity), 0, 0, 1, 1},
  {&__pyx_n_s_get_datetimetz_type, __pyx_k_get_datetimetz_type, sizeof(__pyx_k_get_datetimetz_type), 0, 0, 1, 1},
  {&__pyx_n_s_get_default_context, __pyx_k_get_default_context, sizeof(__pyx_k_get_default_context), 0, 0, 1, 1},
  {&__pyx_n_s_get_field_index, __pyx_k_get_field_index, sizeof(__pyx_k_get_field_index), 0, 0, 1, 1},
  {&__pyx_n_s_get_record_batch, __pyx_k_get_record_batch, sizeof(__pyx_k_get_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_get_record_batch_size, __pyx_k_get_record_batch_size, sizeof(__pyx_k_get_record_batch_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_space_used, __pyx_k_get_space_used, sizeof(__pyx_k_get_space_used), 0, 0, 1, 1},
  {&__pyx_n_s_get_tensor_size, __pyx_k_get_tensor_size, sizeof(__pyx_k_get_tensor_size), 0, 0, 1, 1},
  {&__pyx_n_s_getnewargs, __pyx_k_getnewargs, sizeof(__pyx_k_getnewargs), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_getvalue, __pyx_k_getvalue, sizeof(__pyx_k_getvalue), 0, 0, 1, 1},
  {&__pyx_kp_u_got_null_buffer, __pyx_k_got_null_buffer, sizeof(__pyx_k_got_null_buffer), 0, 1, 0, 0},
  {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1},
  {&__pyx_n_u_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 1, 0, 1},
  {&__pyx_kp_u_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 1, 0, 0},
  {&__pyx_n_u_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 1, 0, 1},
  {&__pyx_n_b_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 0, 1},
  {&__pyx_n_u_halffloat, __pyx_k_halffloat, sizeof(__pyx_k_halffloat), 0, 1, 0, 1},
  {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1},
  {&__pyx_n_s_handle_arrow_array_protocol, __pyx_k_handle_arrow_array_protocol, sizeof(__pyx_k_handle_arrow_array_protocol), 0, 0, 1, 1},
  {&__pyx_n_s_have_libhdfs, __pyx_k_have_libhdfs, sizeof(__pyx_k_have_libhdfs), 0, 0, 1, 1},
  {&__pyx_n_s_have_libhdfs3, __pyx_k_have_libhdfs3, sizeof(__pyx_k_have_libhdfs3), 0, 0, 1, 1},
  {&__pyx_n_s_have_pandas, __pyx_k_have_pandas, sizeof(__pyx_k_have_pandas), 0, 0, 1, 1},
  {&__pyx_kp_u_hdfs_d, __pyx_k_hdfs_d, sizeof(__pyx_k_hdfs_d), 0, 1, 0, 0},
  {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1},
  {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
  {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
  {&__pyx_n_b_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 0, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_u_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 1, 0, 1},
  {&__pyx_n_u_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 1, 0, 1},
  {&__pyx_n_u_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 1, 0, 1},
  {&__pyx_n_u_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 1, 0, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_ignore_metadata, __pyx_k_ignore_metadata, sizeof(__pyx_k_ignore_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in_stream, __pyx_k_in_stream, sizeof(__pyx_k_in_stream), 0, 0, 1, 1},
  {&__pyx_n_s_indent, __pyx_k_indent, sizeof(__pyx_k_indent), 0, 0, 1, 1},
  {&__pyx_kp_u_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 1, 0, 0},
  {&__pyx_n_s_index_type, __pyx_k_index_type, sizeof(__pyx_k_index_type), 0, 0, 1, 1},
  {&__pyx_n_s_index_value, __pyx_k_index_value, sizeof(__pyx_k_index_value), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_u_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 1, 0, 1},
  {&__pyx_n_s_indices_2, __pyx_k_indices_2, sizeof(__pyx_k_indices_2), 0, 0, 1, 1},
  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
  {&__pyx_n_s_infer_dtype, __pyx_k_infer_dtype, sizeof(__pyx_k_infer_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_infer_type, __pyx_k_infer_type, sizeof(__pyx_k_infer_type), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_input_stream, __pyx_k_input_stream, sizeof(__pyx_k_input_stream), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
  {&__pyx_n_u_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 1, 0, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_u_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 1, 0, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_u_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 1, 0, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_n_u_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 1, 0, 1},
  {&__pyx_n_s_integer_object_nulls, __pyx_k_integer_object_nulls, sizeof(__pyx_k_integer_object_nulls), 0, 0, 1, 1},
  {&__pyx_n_u_integer_object_nulls, __pyx_k_integer_object_nulls, sizeof(__pyx_k_integer_object_nulls), 0, 1, 0, 1},
  {&__pyx_n_s_integer_types, __pyx_k_integer_types, sizeof(__pyx_k_integer_types), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_is_alive, __pyx_k_is_alive, sizeof(__pyx_k_is_alive), 0, 0, 1, 1},
  {&__pyx_n_s_is_array_like, __pyx_k_is_array_like, sizeof(__pyx_k_is_array_like), 0, 0, 1, 1},
  {&__pyx_n_s_is_boolean_value, __pyx_k_is_boolean_value, sizeof(__pyx_k_is_boolean_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_categorical, __pyx_k_is_categorical, sizeof(__pyx_k_is_categorical), 0, 0, 1, 1},
  {&__pyx_n_s_is_data_frame, __pyx_k_is_data_frame, sizeof(__pyx_k_is_data_frame), 0, 0, 1, 1},
  {&__pyx_n_s_is_datetimetz, __pyx_k_is_datetimetz, sizeof(__pyx_k_is_datetimetz), 0, 0, 1, 1},
  {&__pyx_n_s_is_float_value, __pyx_k_is_float_value, sizeof(__pyx_k_is_float_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_integer_value, __pyx_k_is_integer_value, sizeof(__pyx_k_is_integer_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_named_tuple, __pyx_k_is_named_tuple, sizeof(__pyx_k_is_named_tuple), 0, 0, 1, 1},
  {&__pyx_n_s_is_named_tuple_locals_genexpr, __pyx_k_is_named_tuple_locals_genexpr, sizeof(__pyx_k_is_named_tuple_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_is_pandas_object, __pyx_k_is_pandas_object, sizeof(__pyx_k_is_pandas_object), 0, 0, 1, 1},
  {&__pyx_n_s_is_primitive, __pyx_k_is_primitive, sizeof(__pyx_k_is_primitive), 0, 0, 1, 1},
  {&__pyx_n_s_is_series, __pyx_k_is_series, sizeof(__pyx_k_is_series), 0, 0, 1, 1},
  {&__pyx_n_s_is_sparse, __pyx_k_is_sparse, sizeof(__pyx_k_is_sparse), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_u_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 1, 0, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_s_iterchunks, __pyx_k_iterchunks, sizeof(__pyx_k_iterchunks), 0, 0, 1, 1},
  {&__pyx_n_s_itercolumns, __pyx_k_itercolumns, sizeof(__pyx_k_itercolumns), 0, 0, 1, 1},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_jemalloc_set_decay_ms, __pyx_k_jemalloc_set_decay_ms, sizeof(__pyx_k_jemalloc_set_decay_ms), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_kerb_ticket, __pyx_k_kerb_ticket, sizeof(__pyx_k_kerb_ticket), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_kp_u_key_must_either_be_a_slice_or_in, __pyx_k_key_must_either_be_a_slice_or_in, sizeof(__pyx_k_key_must_either_be_a_slice_or_in), 0, 1, 0, 0},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_u_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 1, 0, 1},
  {&__pyx_n_s_large_binary, __pyx_k_large_binary, sizeof(__pyx_k_large_binary), 0, 0, 1, 1},
  {&__pyx_n_u_large_binary, __pyx_k_large_binary, sizeof(__pyx_k_large_binary), 0, 1, 0, 1},
  {&__pyx_n_s_large_list, __pyx_k_large_list, sizeof(__pyx_k_large_list), 0, 0, 1, 1},
  {&__pyx_n_u_large_str, __pyx_k_large_str, sizeof(__pyx_k_large_str), 0, 1, 0, 1},
  {&__pyx_n_s_large_string, __pyx_k_large_string, sizeof(__pyx_k_large_string), 0, 0, 1, 1},
  {&__pyx_n_u_large_string, __pyx_k_large_string, sizeof(__pyx_k_large_string), 0, 1, 0, 1},
  {&__pyx_n_s_large_utf8, __pyx_k_large_utf8, sizeof(__pyx_k_large_utf8), 0, 0, 1, 1},
  {&__pyx_n_u_large_utf8, __pyx_k_large_utf8, sizeof(__pyx_k_large_utf8), 0, 1, 0, 1},
  {&__pyx_n_u_last_access_time, __pyx_k_last_access_time, sizeof(__pyx_k_last_access_time), 0, 1, 0, 1},
  {&__pyx_n_u_last_accessed, __pyx_k_last_accessed, sizeof(__pyx_k_last_accessed), 0, 1, 0, 1},
  {&__pyx_n_u_last_modified, __pyx_k_last_modified, sizeof(__pyx_k_last_modified), 0, 1, 0, 1},
  {&__pyx_n_u_last_modified_time, __pyx_k_last_modified_time, sizeof(__pyx_k_last_modified_time), 0, 1, 0, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
  {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1},
  {&__pyx_n_u_libhdfs, __pyx_k_libhdfs, sizeof(__pyx_k_libhdfs), 0, 1, 0, 1},
  {&__pyx_n_u_libhdfs3, __pyx_k_libhdfs3, sizeof(__pyx_k_libhdfs3), 0, 1, 0, 1},
  {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_log_memory_allocations, __pyx_k_log_memory_allocations, sizeof(__pyx_k_log_memory_allocations), 0, 0, 1, 1},
  {&__pyx_n_s_logging_memory_pool, __pyx_k_logging_memory_pool, sizeof(__pyx_k_logging_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_u_lz4, __pyx_k_lz4, sizeof(__pyx_k_lz4), 0, 1, 0, 1},
  {&__pyx_kp_u_lz4_2, __pyx_k_lz4_2, sizeof(__pyx_k_lz4_2), 0, 1, 0, 0},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_ma, __pyx_k_ma, sizeof(__pyx_k_ma), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_datetimetz, __pyx_k_make_datetimetz, sizeof(__pyx_k_make_datetimetz), 0, 0, 1, 1},
  {&__pyx_n_s_make_tz_aware, __pyx_k_make_tz_aware, sizeof(__pyx_k_make_tz_aware), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_kp_u_mask_not_implemented_with_Arrow, __pyx_k_mask_not_implemented_with_Arrow, sizeof(__pyx_k_mask_not_implemented_with_Arrow), 0, 1, 0, 0},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
  {&__pyx_n_s_max_chunksize, __pyx_k_max_chunksize, sizeof(__pyx_k_max_chunksize), 0, 0, 1, 1},
  {&__pyx_n_s_max_output_size, __pyx_k_max_output_size, sizeof(__pyx_k_max_output_size), 0, 0, 1, 1},
  {&__pyx_n_s_memory_map, __pyx_k_memory_map, sizeof(__pyx_k_memory_map), 0, 0, 1, 1},
  {&__pyx_n_s_memory_pool, __pyx_k_memory_pool, sizeof(__pyx_k_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_memoryview, __pyx_k_memoryview, sizeof(__pyx_k_memoryview), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_metadata, __pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 0, 1, 1},
  {&__pyx_kp_u_metadata_2, __pyx_k_metadata_2, sizeof(__pyx_k_metadata_2), 0, 1, 0, 0},
  {&__pyx_n_s_metadata_length, __pyx_k_metadata_length, sizeof(__pyx_k_metadata_length), 0, 0, 1, 1},
  {&__pyx_n_s_micros, __pyx_k_micros, sizeof(__pyx_k_micros), 0, 0, 1, 1},
  {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
  {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
  {&__pyx_n_s_microseconds_to_datetime, __pyx_k_microseconds_to_datetime, sizeof(__pyx_k_microseconds_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_millis, __pyx_k_millis, sizeof(__pyx_k_millis), 0, 0, 1, 1},
  {&__pyx_n_s_millis_to_datetime, __pyx_k_millis_to_datetime, sizeof(__pyx_k_millis_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1},
  {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1},
  {&__pyx_n_s_mmap, __pyx_k_mmap, sizeof(__pyx_k_mmap), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mro, __pyx_k_mro, sizeof(__pyx_k_mro), 0, 0, 1, 1},
  {&__pyx_n_u_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 0, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
  {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
  {&__pyx_n_s_nanoseconds_to_datetime_safe, __pyx_k_nanoseconds_to_datetime_safe, sizeof(__pyx_k_nanoseconds_to_datetime_safe), 0, 0, 1, 1},
  {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
  {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1},
  {&__pyx_n_s_ndarray_to_arrow_type, __pyx_k_ndarray_to_arrow_type, sizeof(__pyx_k_ndarray_to_arrow_type), 0, 0, 1, 1},
  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_new_path, __pyx_k_new_path, sizeof(__pyx_k_new_path), 0, 0, 1, 1},
  {&__pyx_n_s_new_size, __pyx_k_new_size, sizeof(__pyx_k_new_size), 0, 0, 1, 1},
  {&__pyx_n_s_nf, __pyx_k_nf, sizeof(__pyx_k_nf), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_normalize_slice, __pyx_k_normalize_slice, sizeof(__pyx_k_normalize_slice), 0, 0, 1, 1},
  {&__pyx_kp_u_not_registered_in_deserializati, __pyx_k_not_registered_in_deserializati, sizeof(__pyx_k_not_registered_in_deserializati), 0, 1, 0, 0},
  {&__pyx_kp_u_not_supported_for_buffer_protoc, __pyx_k_not_supported_for_buffer_protoc, sizeof(__pyx_k_not_supported_for_buffer_protoc), 0, 1, 0, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_u_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 0, 1},
  {&__pyx_n_s_nthreads, __pyx_k_nthreads, sizeof(__pyx_k_nthreads), 0, 0, 1, 1},
  {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1},
  {&__pyx_n_u_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 1, 0, 1},
  {&__pyx_n_s_null_bitmap, __pyx_k_null_bitmap, sizeof(__pyx_k_null_bitmap), 0, 0, 1, 1},
  {&__pyx_n_s_null_count, __pyx_k_null_count, sizeof(__pyx_k_null_count), 0, 0, 1, 1},
  {&__pyx_n_s_nullable, __pyx_k_nullable, sizeof(__pyx_k_nullable), 0, 0, 1, 1},
  {&__pyx_n_s_num_arrays, __pyx_k_num_arrays, sizeof(__pyx_k_num_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_num_buffers, __pyx_k_num_buffers, sizeof(__pyx_k_num_buffers), 0, 0, 1, 1},
  {&__pyx_n_u_num_buffers, __pyx_k_num_buffers, sizeof(__pyx_k_num_buffers), 0, 1, 0, 1},
  {&__pyx_n_s_num_children, __pyx_k_num_children, sizeof(__pyx_k_num_children), 0, 0, 1, 1},
  {&__pyx_n_s_num_chunks, __pyx_k_num_chunks, sizeof(__pyx_k_num_chunks), 0, 0, 1, 1},
  {&__pyx_n_s_num_columns, __pyx_k_num_columns, sizeof(__pyx_k_num_columns), 0, 0, 1, 1},
  {&__pyx_n_s_num_ndarrays, __pyx_k_num_ndarrays, sizeof(__pyx_k_num_ndarrays), 0, 0, 1, 1},
  {&__pyx_n_u_num_ndarrays, __pyx_k_num_ndarrays, sizeof(__pyx_k_num_ndarrays), 0, 1, 0, 1},
  {&__pyx_n_s_num_record_batches, __pyx_k_num_record_batches, sizeof(__pyx_k_num_record_batches), 0, 0, 1, 1},
  {&__pyx_n_s_num_rows, __pyx_k_num_rows, sizeof(__pyx_k_num_rows), 0, 0, 1, 1},
  {&__pyx_n_s_num_tensors, __pyx_k_num_tensors, sizeof(__pyx_k_num_tensors), 0, 0, 1, 1},
  {&__pyx_n_u_num_tensors, __pyx_k_num_tensors, sizeof(__pyx_k_num_tensors), 0, 1, 0, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_offsets, __pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 0, 1, 1},
  {&__pyx_n_s_offsets_2, __pyx_k_offsets_2, sizeof(__pyx_k_offsets_2), 0, 0, 1, 1},
  {&__pyx_kp_u_only_slices_with_step_1_supporte, __pyx_k_only_slices_with_step_1_supporte, sizeof(__pyx_k_only_slices_with_step_1_supporte), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_readonly_files, __pyx_k_only_valid_on_readonly_files, sizeof(__pyx_k_only_valid_on_readonly_files), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_seekable_files, __pyx_k_only_valid_on_seekable_files, sizeof(__pyx_k_only_valid_on_seekable_files), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_writable_files, __pyx_k_only_valid_on_writable_files, sizeof(__pyx_k_only_valid_on_writable_files), 0, 1, 0, 0},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_open_2, __pyx_k_open_2, sizeof(__pyx_k_open_2), 0, 0, 1, 1},
  {&__pyx_n_s_open_stream, __pyx_k_open_stream, sizeof(__pyx_k_open_stream), 0, 0, 1, 1},
  {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  {&__pyx_n_s_ordered, __pyx_k_ordered, sizeof(__pyx_k_ordered), 0, 0, 1, 1},
  {&__pyx_n_u_ordered, __pyx_k_ordered, sizeof(__pyx_k_ordered), 0, 1, 0, 1},
  {&__pyx_n_s_ordered_dict, __pyx_k_ordered_dict, sizeof(__pyx_k_ordered_dict), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_out_buf, __pyx_k_out_buf, sizeof(__pyx_k_out_buf), 0, 0, 1, 1},
  {&__pyx_n_s_output_buffer, __pyx_k_output_buffer, sizeof(__pyx_k_output_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_output_length, __pyx_k_output_length, sizeof(__pyx_k_output_length), 0, 0, 1, 1},
  {&__pyx_n_s_output_size, __pyx_k_output_size, sizeof(__pyx_k_output_size), 0, 0, 1, 1},
  {&__pyx_n_s_output_stream, __pyx_k_output_stream, sizeof(__pyx_k_output_stream), 0, 0, 1, 1},
  {&__pyx_n_s_owned_buf, __pyx_k_owned_buf, sizeof(__pyx_k_owned_buf), 0, 0, 1, 1},
  {&__pyx_n_s_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 0, 1, 1},
  {&__pyx_n_u_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 1, 0, 1},
  {&__pyx_n_u_pa_getnewargs, __pyx_k_pa_getnewargs, sizeof(__pyx_k_pa_getnewargs), 0, 1, 0, 1},
  {&__pyx_kp_u_pa_input_stream_called_with_inst, __pyx_k_pa_input_stream_called_with_inst, sizeof(__pyx_k_pa_input_stream_called_with_inst), 0, 1, 0, 0},
  {&__pyx_kp_u_pa_output_stream_called_with_ins, __pyx_k_pa_output_stream_called_with_ins, sizeof(__pyx_k_pa_output_stream_called_with_ins), 0, 1, 0, 0},
  {&__pyx_n_b_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 0, 1},
  {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_api, __pyx_k_pandas_api, sizeof(__pyx_k_pandas_api), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_api_types, __pyx_k_pandas_api_types, sizeof(__pyx_k_pandas_api_types), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_types_dtypes, __pyx_k_pandas_types_dtypes, sizeof(__pyx_k_pandas_types_dtypes), 0, 0, 1, 1},
  {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1},
  {&__pyx_n_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1},
  {&__pyx_n_u_permissions, __pyx_k_permissions, sizeof(__pyx_k_permissions), 0, 1, 0, 1},
  {&__pyx_n_s_pformat, __pyx_k_pformat, sizeof(__pyx_k_pformat), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_u_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 1, 0, 1},
  {&__pyx_kp_u_please_pass_it_explicitly, __pyx_k_please_pass_it_explicitly, sizeof(__pyx_k_please_pass_it_explicitly), 0, 1, 0, 0},
  {&__pyx_n_s_pool, __pyx_k_pool, sizeof(__pyx_k_pool), 0, 0, 1, 1},
  {&__pyx_n_u_pool, __pyx_k_pool, sizeof(__pyx_k_pool), 0, 1, 0, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
  {&__pyx_n_s_pprint, __pyx_k_pprint, sizeof(__pyx_k_pprint), 0, 0, 1, 1},
  {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
  {&__pyx_kp_u_precision_should_be_between_1_an, __pyx_k_precision_should_be_between_1_an, sizeof(__pyx_k_precision_should_be_between_1_an), 0, 1, 0, 0},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_preserve_index, __pyx_k_preserve_index, sizeof(__pyx_k_preserve_index), 0, 0, 1, 1},
  {&__pyx_kp_u_prior_column_had_a_different_num, __pyx_k_prior_column_had_a_different_num, sizeof(__pyx_k_prior_column_had_a_different_num), 0, 1, 0, 0},
  {&__pyx_n_s_proxy_memory_pool, __pyx_k_proxy_memory_pool, sizeof(__pyx_k_proxy_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_put_nowait, __pyx_k_put_nowait, sizeof(__pyx_k_put_nowait), 0, 0, 1, 1},
  {&__pyx_n_s_py_buffer, __pyx_k_py_buffer, sizeof(__pyx_k_py_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_py_field, __pyx_k_py_field, sizeof(__pyx_k_py_field), 0, 0, 1, 1},
  {&__pyx_kp_u_pyarrow, __pyx_k_pyarrow, sizeof(__pyx_k_pyarrow), 0, 1, 0, 0},
  {&__pyx_n_s_pyarrow_2, __pyx_k_pyarrow_2, sizeof(__pyx_k_pyarrow_2), 0, 0, 1, 1},
  {&__pyx_kp_u_pyarrow_Field_0, __pyx_k_pyarrow_Field_0, sizeof(__pyx_k_pyarrow_Field_0), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Message_type_0_metadata, __pyx_k_pyarrow_Message_type_0_metadata, sizeof(__pyx_k_pyarrow_Message_type_0_metadata), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Message_unitialized, __pyx_k_pyarrow_Message_unitialized, sizeof(__pyx_k_pyarrow_Message_unitialized), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_SparseTensorCOO_type_0, __pyx_k_pyarrow_SparseTensorCOO_type_0, sizeof(__pyx_k_pyarrow_SparseTensorCOO_type_0), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_SparseTensorCSR_type_0, __pyx_k_pyarrow_SparseTensorCSR_type_0, sizeof(__pyx_k_pyarrow_SparseTensorCSR_type_0), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Tensor_type_0_type_shap, __pyx_k_pyarrow_Tensor_type_0_type_shap, sizeof(__pyx_k_pyarrow_Tensor_type_0_type_shap), 0, 1, 0, 0},
  {&__pyx_kp_s_pyarrow_array_pxi, __pyx_k_pyarrow_array_pxi, sizeof(__pyx_k_pyarrow_array_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_benchmark_pxi, __pyx_k_pyarrow_benchmark_pxi, sizeof(__pyx_k_pyarrow_benchmark_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_compat, __pyx_k_pyarrow_compat, sizeof(__pyx_k_pyarrow_compat), 0, 0, 1, 1},
  {&__pyx_kp_u_pyarrow_does_not_know_how_to_ser, __pyx_k_pyarrow_does_not_know_how_to_ser, sizeof(__pyx_k_pyarrow_does_not_know_how_to_ser), 0, 1, 0, 0},
  {&__pyx_kp_s_pyarrow_error_pxi, __pyx_k_pyarrow_error_pxi, sizeof(__pyx_k_pyarrow_error_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_k_pyarrow_io_hdfs_pxi, sizeof(__pyx_k_pyarrow_io_hdfs_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_io_pxi, __pyx_k_pyarrow_io_pxi, sizeof(__pyx_k_pyarrow_io_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_ipc_pxi, __pyx_k_pyarrow_ipc_pxi, sizeof(__pyx_k_pyarrow_ipc_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_lib, __pyx_k_pyarrow_lib, sizeof(__pyx_k_pyarrow_lib), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_lib_pyx, __pyx_k_pyarrow_lib_pyx, sizeof(__pyx_k_pyarrow_lib_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_memory_pxi, __pyx_k_pyarrow_memory_pxi, sizeof(__pyx_k_pyarrow_memory_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_pandas_compat, __pyx_k_pyarrow_pandas_compat, sizeof(__pyx_k_pyarrow_pandas_compat), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_scalar_pxi, __pyx_k_pyarrow_scalar_pxi, sizeof(__pyx_k_pyarrow_scalar_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_serialization, __pyx_k_pyarrow_serialization, sizeof(__pyx_k_pyarrow_serialization), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_serialization_pxi, __pyx_k_pyarrow_serialization_pxi, sizeof(__pyx_k_pyarrow_serialization_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_table_pxi, __pyx_k_pyarrow_table_pxi, sizeof(__pyx_k_pyarrow_table_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_tensor_pxi, __pyx_k_pyarrow_tensor_pxi, sizeof(__pyx_k_pyarrow_tensor_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_types_pxi, __pyx_k_pyarrow_types_pxi, sizeof(__pyx_k_pyarrow_types_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_util, __pyx_k_pyarrow_util, sizeof(__pyx_k_pyarrow_util), 0, 0, 1, 1},
  {&__pyx_n_s_pybuf, __pyx_k_pybuf, sizeof(__pyx_k_pybuf), 0, 0, 1, 1},
  {&__pyx_n_s_pydecimal, __pyx_k_pydecimal, sizeof(__pyx_k_pydecimal), 0, 0, 1, 1},
  {&__pyx_n_s_pyobj, __pyx_k_pyobj, sizeof(__pyx_k_pyobj), 0, 0, 1, 1},
  {&__pyx_n_s_python_extension_types_registry, __pyx_k_python_extension_types_registry, sizeof(__pyx_k_python_extension_types_registry), 0, 0, 1, 1},
  {&__pyx_n_u_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 1, 0, 1},
  {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Scalar, __pyx_k_pyx_unpickle_Scalar, sizeof(__pyx_k_pyx_unpickle_Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_SerializationCont, __pyx_k_pyx_unpickle_SerializationCont, sizeof(__pyx_k_pyx_unpickle_SerializationCont), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle__PandasAPIShim, __pyx_k_pyx_unpickle__PandasAPIShim, sizeof(__pyx_k_pyx_unpickle__PandasAPIShim), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle__PandasConvertibl, __pyx_k_pyx_unpickle__PandasConvertibl, sizeof(__pyx_k_pyx_unpickle__PandasConvertibl), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_b_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 0, 1},
  {&__pyx_n_s_qsize, __pyx_k_qsize, sizeof(__pyx_k_qsize), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1},
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
  {&__pyx_kp_u_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 1, 0, 0},
  {&__pyx_kp_u_r_b, __pyx_k_r_b, sizeof(__pyx_k_r_b), 0, 1, 0, 0},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_kp_u_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 1, 0, 0},
  {&__pyx_n_u_rb_2, __pyx_k_rb_2, sizeof(__pyx_k_rb_2), 0, 1, 0, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_u_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 1, 0, 1},
  {&__pyx_n_s_read_message, __pyx_k_read_message, sizeof(__pyx_k_read_message), 0, 0, 1, 1},
  {&__pyx_n_s_read_next_batch, __pyx_k_read_next_batch, sizeof(__pyx_k_read_next_batch), 0, 0, 1, 1},
  {&__pyx_n_s_read_next_message, __pyx_k_read_next_message, sizeof(__pyx_k_read_next_message), 0, 0, 1, 1},
  {&__pyx_n_s_read_record_batch, __pyx_k_read_record_batch, sizeof(__pyx_k_read_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_read_schema, __pyx_k_read_schema, sizeof(__pyx_k_read_schema), 0, 0, 1, 1},
  {&__pyx_n_s_read_serialized, __pyx_k_read_serialized, sizeof(__pyx_k_read_serialized), 0, 0, 1, 1},
  {&__pyx_n_s_read_tensor, __pyx_k_read_tensor, sizeof(__pyx_k_read_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_readable, __pyx_k_readable, sizeof(__pyx_k_readable), 0, 0, 1, 1},
  {&__pyx_kp_u_readable_file_expected, __pyx_k_readable_file_expected, sizeof(__pyx_k_readable_file_expected), 0, 1, 0, 0},
  {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1},
  {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
  {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
  {&__pyx_n_s_reconstruct_record_batch, __pyx_k_reconstruct_record_batch, sizeof(__pyx_k_reconstruct_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_reconstruct_table, __pyx_k_reconstruct_table, sizeof(__pyx_k_reconstruct_table), 0, 0, 1, 1},
  {&__pyx_n_s_record_batch, __pyx_k_record_batch, sizeof(__pyx_k_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_recursive, __pyx_k_recursive, sizeof(__pyx_k_recursive), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
  {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
  {&__pyx_n_s_register_default_serialization_h, __pyx_k_register_default_serialization_h, sizeof(__pyx_k_register_default_serialization_h), 0, 0, 1, 1},
  {&__pyx_n_s_register_extension_type, __pyx_k_register_extension_type, sizeof(__pyx_k_register_extension_type), 0, 0, 1, 1},
  {&__pyx_n_s_register_py_extension_type, __pyx_k_register_py_extension_type, sizeof(__pyx_k_register_py_extension_type), 0, 0, 1, 1},
  {&__pyx_n_s_registry_nanny, __pyx_k_registry_nanny, sizeof(__pyx_k_registry_nanny), 0, 0, 1, 1},
  {&__pyx_n_s_release_registry, __pyx_k_release_registry, sizeof(__pyx_k_release_registry), 0, 0, 1, 1},
  {&__pyx_n_s_remove_column, __pyx_k_remove_column, sizeof(__pyx_k_remove_column), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_replication, __pyx_k_replication, sizeof(__pyx_k_replication), 0, 0, 1, 1},
  {&__pyx_n_u_replication, __pyx_k_replication, sizeof(__pyx_k_replication), 0, 1, 0, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_require, __pyx_k_require, sizeof(__pyx_k_require), 0, 0, 1, 1},
  {&__pyx_n_s_requirements, __pyx_k_requirements, sizeof(__pyx_k_requirements), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_resizable, __pyx_k_resizable, sizeof(__pyx_k_resizable), 0, 0, 1, 1},
  {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
  {&__pyx_n_s_restore_array, __pyx_k_restore_array, sizeof(__pyx_k_restore_array), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_result_obj, __pyx_k_result_obj, sizeof(__pyx_k_result_obj), 0, 0, 1, 1},
  {&__pyx_n_s_rz_buffer, __pyx_k_rz_buffer, sizeof(__pyx_k_rz_buffer), 0, 0, 1, 1},
  {&__pyx_n_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 1},
  {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1},
  {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
  {&__pyx_n_s_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 0, 0, 1, 1},
  {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1},
  {&__pyx_n_s_seconds_to_datetime, __pyx_k_seconds_to_datetime, sizeof(__pyx_k_seconds_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_kp_s_self_ap_self_sp_array_cannot_be, __pyx_k_self_ap_self_sp_array_cannot_be, sizeof(__pyx_k_self_ap_self_sp_array_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self_client_cannot_be_converted, __pyx_k_self_client_cannot_be_converted, sizeof(__pyx_k_self_client_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self_data_cannot_be_converted_to, __pyx_k_self_data_cannot_be_converted_to, sizeof(__pyx_k_self_data_cannot_be_converted_to), 0, 0, 1, 0},
  {&__pyx_kp_s_self_logging_pool_self_pool_cann, __pyx_k_self_logging_pool_self_pool_cann, sizeof(__pyx_k_self_logging_pool_self_pool_cann), 0, 0, 1, 0},
  {&__pyx_kp_s_self_pool_cannot_be_converted_to, __pyx_k_self_pool_cannot_be_converted_to, sizeof(__pyx_k_self_pool_cannot_be_converted_to), 0, 0, 1, 0},
  {&__pyx_kp_s_self_pool_self_proxy_pool_cannot, __pyx_k_self_pool_self_proxy_pool_cannot, sizeof(__pyx_k_self_pool_self_proxy_pool_cannot), 0, 0, 1, 0},
  {&__pyx_kp_s_self_reader_cannot_be_converted, __pyx_k_self_reader_cannot_be_converted, sizeof(__pyx_k_self_reader_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_array_cannot_be_converte, __pyx_k_self_sp_array_cannot_be_converte, sizeof(__pyx_k_self_sp_array_cannot_be_converte), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_scalar_cannot_be_convert, __pyx_k_self_sp_scalar_cannot_be_convert, sizeof(__pyx_k_self_sp_scalar_cannot_be_convert), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_sparse_tensor_self_stp_c, __pyx_k_self_sp_sparse_tensor_self_stp_c, sizeof(__pyx_k_self_sp_sparse_tensor_self_stp_c), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_tensor_self_tp_cannot_be, __pyx_k_self_sp_tensor_self_tp_cannot_be, sizeof(__pyx_k_self_sp_tensor_self_tp_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self_writer_cannot_be_converted, __pyx_k_self_writer_cannot_be_converted, sizeof(__pyx_k_self_writer_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_serialize, __pyx_k_serialize, sizeof(__pyx_k_serialize), 0, 0, 1, 1},
  {&__pyx_n_s_serialize_to, __pyx_k_serialize_to, sizeof(__pyx_k_serialize_to), 0, 0, 1, 1},
  {&__pyx_n_s_serialized, __pyx_k_serialized, sizeof(__pyx_k_serialized), 0, 0, 1, 1},
  {&__pyx_n_s_serializer, __pyx_k_serializer, sizeof(__pyx_k_serializer), 0, 0, 1, 1},
  {&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1},
  {&__pyx_n_s_set_cpu_count, __pyx_k_set_cpu_count, sizeof(__pyx_k_set_cpu_count), 0, 0, 1, 1},
  {&__pyx_n_s_set_memcopy_threads, __pyx_k_set_memcopy_threads, sizeof(__pyx_k_set_memcopy_threads), 0, 0, 1, 1},
  {&__pyx_n_s_set_memory_pool, __pyx_k_set_memory_pool, sizeof(__pyx_k_set_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_shrink_to_fit, __pyx_k_shrink_to_fit, sizeof(__pyx_k_shrink_to_fit), 0, 0, 1, 1},
  {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1},
  {&__pyx_n_s_sink, __pyx_k_sink, sizeof(__pyx_k_sink), 0, 0, 1, 1},
  {&__pyx_n_s_six, __pyx_k_six, sizeof(__pyx_k_six), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_u_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 1, 0, 1},
  {&__pyx_n_s_skipna, __pyx_k_skipna, sizeof(__pyx_k_skipna), 0, 0, 1, 1},
  {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
  {&__pyx_n_s_slice, __pyx_k_slice, sizeof(__pyx_k_slice), 0, 0, 1, 1},
  {&__pyx_n_u_snappy, __pyx_k_snappy, sizeof(__pyx_k_snappy), 0, 1, 0, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_source_path, __pyx_k_source_path, sizeof(__pyx_k_source_path), 0, 0, 1, 1},
  {&__pyx_n_s_sp_chunked_array, __pyx_k_sp_chunked_array, sizeof(__pyx_k_sp_chunked_array), 0, 0, 1, 1},
  {&__pyx_n_s_sp_data_type, __pyx_k_sp_data_type, sizeof(__pyx_k_sp_data_type), 0, 0, 1, 1},
  {&__pyx_n_s_sp_tensor, __pyx_k_sp_tensor, sizeof(__pyx_k_sp_tensor), 0, 0, 1, 1},
  {&__pyx_n_u_sparse, __pyx_k_sparse, sizeof(__pyx_k_sparse), 0, 1, 0, 1},
  {&__pyx_n_s_stacklevel, __pyx_k_stacklevel, sizeof(__pyx_k_stacklevel), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_storage, __pyx_k_storage, sizeof(__pyx_k_storage), 0, 0, 1, 1},
  {&__pyx_n_s_storage_type, __pyx_k_storage_type, sizeof(__pyx_k_storage_type), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_u_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 1, 0, 1},
  {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
  {&__pyx_n_s_stream_or_path, __pyx_k_stream_or_path, sizeof(__pyx_k_stream_or_path), 0, 0, 1, 1},
  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
  {&__pyx_n_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 1},
  {&__pyx_n_s_string_to_tzinfo, __pyx_k_string_to_tzinfo, sizeof(__pyx_k_string_to_tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1},
  {&__pyx_n_s_stringify_path, __pyx_k_stringify_path, sizeof(__pyx_k_stringify_path), 0, 0, 1, 1},
  {&__pyx_n_s_strings_to_categorical, __pyx_k_strings_to_categorical, sizeof(__pyx_k_strings_to_categorical), 0, 0, 1, 1},
  {&__pyx_n_u_strings_to_categorical, __pyx_k_strings_to_categorical, sizeof(__pyx_k_strings_to_categorical), 0, 1, 0, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_strip_hdfs_abspath, __pyx_k_strip_hdfs_abspath, sizeof(__pyx_k_strip_hdfs_abspath), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_struct_type, __pyx_k_struct_type, sizeof(__pyx_k_struct_type), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1},
  {&__pyx_n_s_table_to_blockmanager, __pyx_k_table_to_blockmanager, sizeof(__pyx_k_table_to_blockmanager), 0, 0, 1, 1},
  {&__pyx_n_s_table_to_blocks, __pyx_k_table_to_blocks, sizeof(__pyx_k_table_to_blocks), 0, 0, 1, 1},
  {&__pyx_n_s_tables, __pyx_k_tables, sizeof(__pyx_k_tables), 0, 0, 1, 1},
  {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_target_schema, __pyx_k_target_schema, sizeof(__pyx_k_target_schema), 0, 0, 1, 1},
  {&__pyx_n_s_target_type, __pyx_k_target_type, sizeof(__pyx_k_target_type), 0, 0, 1, 1},
  {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1},
  {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
  {&__pyx_n_s_temp_memo, __pyx_k_temp_memo, sizeof(__pyx_k_temp_memo), 0, 0, 1, 1},
  {&__pyx_n_s_tensor, __pyx_k_tensor, sizeof(__pyx_k_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_testing, __pyx_k_testing, sizeof(__pyx_k_testing), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_time32, __pyx_k_time32, sizeof(__pyx_k_time32), 0, 0, 1, 1},
  {&__pyx_kp_u_time32_ms, __pyx_k_time32_ms, sizeof(__pyx_k_time32_ms), 0, 1, 0, 0},
  {&__pyx_kp_u_time32_s, __pyx_k_time32_s, sizeof(__pyx_k_time32_s), 0, 1, 0, 0},
  {&__pyx_n_s_time64, __pyx_k_time64, sizeof(__pyx_k_time64), 0, 0, 1, 1},
  {&__pyx_kp_u_time64_ns, __pyx_k_time64_ns, sizeof(__pyx_k_time64_ns), 0, 1, 0, 0},
  {&__pyx_kp_u_time64_us, __pyx_k_time64_us, sizeof(__pyx_k_time64_us), 0, 1, 0, 0},
  {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
  {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1},
  {&__pyx_kp_u_timestamp_ms, __pyx_k_timestamp_ms, sizeof(__pyx_k_timestamp_ms), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_ns, __pyx_k_timestamp_ns, sizeof(__pyx_k_timestamp_ns), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_s, __pyx_k_timestamp_s, sizeof(__pyx_k_timestamp_s), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_us, __pyx_k_timestamp_us, sizeof(__pyx_k_timestamp_us), 0, 1, 0, 0},
  {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas, __pyx_k_to_pandas, sizeof(__pyx_k_to_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas_2, __pyx_k_to_pandas_2, sizeof(__pyx_k_to_pandas_2), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas_dtype, __pyx_k_to_pandas_dtype, sizeof(__pyx_k_to_pandas_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_to_pybytes, __pyx_k_to_pybytes, sizeof(__pyx_k_to_pybytes), 0, 0, 1, 1},
  {&__pyx_n_s_to_pylist, __pyx_k_to_pylist, sizeof(__pyx_k_to_pylist), 0, 0, 1, 1},
  {&__pyx_n_s_tobytes, __pyx_k_tobytes, sizeof(__pyx_k_tobytes), 0, 0, 1, 1},
  {&__pyx_n_s_total_allocated_bytes, __pyx_k_total_allocated_bytes, sizeof(__pyx_k_total_allocated_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_total_bytes, __pyx_k_total_bytes, sizeof(__pyx_k_total_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_total_seconds, __pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 0, 1, 1},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_kp_u_trying_to_write_an_immutable_buf, __pyx_k_trying_to_write_an_immutable_buf, sizeof(__pyx_k_trying_to_write_an_immutable_buf), 0, 1, 0, 0},
  {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_kp_u_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 1, 0, 0},
  {&__pyx_n_s_type_3, __pyx_k_type_3, sizeof(__pyx_k_type_3), 0, 0, 1, 1},
  {&__pyx_n_s_type_4, __pyx_k_type_4, sizeof(__pyx_k_type_4), 0, 0, 1, 1},
  {&__pyx_n_s_type_codes, __pyx_k_type_codes, sizeof(__pyx_k_type_codes), 0, 0, 1, 1},
  {&__pyx_n_s_type_for_alias, __pyx_k_type_for_alias, sizeof(__pyx_k_type_for_alias), 0, 0, 1, 1},
  {&__pyx_n_s_type_id, __pyx_k_type_id, sizeof(__pyx_k_type_id), 0, 0, 1, 1},
  {&__pyx_n_s_type_name, __pyx_k_type_name, sizeof(__pyx_k_type_name), 0, 0, 1, 1},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo_to_string, __pyx_k_tzinfo_to_string, sizeof(__pyx_k_tzinfo_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo_to_string_locals_fixed_of, __pyx_k_tzinfo_to_string_locals_fixed_of, sizeof(__pyx_k_tzinfo_to_string_locals_fixed_of), 0, 0, 1, 1},
  {&__pyx_n_u_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 1, 0, 1},
  {&__pyx_n_u_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 1, 0, 1},
  {&__pyx_n_u_u4, __pyx_k_u4, sizeof(__pyx_k_u4), 0, 1, 0, 1},
  {&__pyx_n_u_u8, __pyx_k_u8, sizeof(__pyx_k_u8), 0, 1, 0, 1},
  {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
  {&__pyx_n_u_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 1, 0, 1},
  {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
  {&__pyx_n_u_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 1, 0, 1},
  {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1},
  {&__pyx_n_u_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 1, 0, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_u_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 1, 0, 1},
  {&__pyx_n_u_uncompressed, __pyx_k_uncompressed, sizeof(__pyx_k_uncompressed), 0, 1, 0, 1},
  {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
  {&__pyx_n_s_union_type, __pyx_k_union_type, sizeof(__pyx_k_union_type), 0, 0, 1, 1},
  {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1},
  {&__pyx_n_s_unit_code, __pyx_k_unit_code, sizeof(__pyx_k_unit_code), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_driver_r, __pyx_k_unknown_driver_r, sizeof(__pyx_k_unknown_driver_r), 0, 1, 0, 0},
  {&__pyx_n_s_unregister_extension_type, __pyx_k_unregister_extension_type, sizeof(__pyx_k_unregister_extension_type), 0, 0, 1, 1},
  {&__pyx_n_s_unregister_py_extension_types, __pyx_k_unregister_py_extension_types, sizeof(__pyx_k_unregister_py_extension_types), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_upload, __pyx_k_upload, sizeof(__pyx_k_upload), 0, 0, 1, 1},
  {&__pyx_n_s_upload_locals_bg_write, __pyx_k_upload_locals_bg_write, sizeof(__pyx_k_upload_locals_bg_write), 0, 0, 1, 1},
  {&__pyx_n_u_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 1, 0, 1},
  {&__pyx_n_s_use_legacy_format, __pyx_k_use_legacy_format, sizeof(__pyx_k_use_legacy_format), 0, 0, 1, 1},
  {&__pyx_n_s_use_memory_map, __pyx_k_use_memory_map, sizeof(__pyx_k_use_memory_map), 0, 0, 1, 1},
  {&__pyx_n_s_use_pandas_sentinels, __pyx_k_use_pandas_sentinels, sizeof(__pyx_k_use_pandas_sentinels), 0, 0, 1, 1},
  {&__pyx_n_s_use_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 0, 1, 1},
  {&__pyx_n_u_use_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 1, 0, 1},
  {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1},
  {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1},
  {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
  {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1},
  {&__pyx_n_s_util, __pyx_k_util, sizeof(__pyx_k_util), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_value_offsets, __pyx_k_value_offsets, sizeof(__pyx_k_value_offsets), 0, 0, 1, 1},
  {&__pyx_n_s_value_type, __pyx_k_value_type, sizeof(__pyx_k_value_type), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_values_2, __pyx_k_values_2, sizeof(__pyx_k_values_2), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_u_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 1, 0, 1},
  {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
  {&__pyx_n_s_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 0, 0, 1, 1},
  {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1},
  {&__pyx_n_s_with_metadata, __pyx_k_with_metadata, sizeof(__pyx_k_with_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_wrapped_value, __pyx_k_wrapped_value, sizeof(__pyx_k_wrapped_value), 0, 0, 1, 1},
  {&__pyx_n_s_writable, __pyx_k_writable, sizeof(__pyx_k_writable), 0, 0, 1, 1},
  {&__pyx_kp_u_writable_file_expected, __pyx_k_writable_file_expected, sizeof(__pyx_k_writable_file_expected), 0, 1, 0, 0},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_u_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 1, 0, 1},
  {&__pyx_n_s_write_batch, __pyx_k_write_batch, sizeof(__pyx_k_write_batch), 0, 0, 1, 1},
  {&__pyx_n_s_write_table, __pyx_k_write_table, sizeof(__pyx_k_write_table), 0, 0, 1, 1},
  {&__pyx_n_s_write_tensor, __pyx_k_write_tensor, sizeof(__pyx_k_write_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_write_to, __pyx_k_write_to, sizeof(__pyx_k_write_to), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_zero_copy_only, __pyx_k_zero_copy_only, sizeof(__pyx_k_zero_copy_only), 0, 0, 1, 1},
  {&__pyx_n_u_zero_copy_only, __pyx_k_zero_copy_only, sizeof(__pyx_k_zero_copy_only), 0, 1, 0, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {&__pyx_n_s_zone, __pyx_k_zone, sizeof(__pyx_k_zone), 0, 0, 1, 1},
  {&__pyx_kp_u_zst, __pyx_k_zst, sizeof(__pyx_k_zst), 0, 1, 0, 0},
  {&__pyx_n_u_zstd, __pyx_k_zstd, sizeof(__pyx_k_zstd), 0, 1, 0, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 27, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 31, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 35, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 39, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 45, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 49, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 57, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(1, 628, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 26, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(3, 130, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(4, 161, __pyx_L1_error)
  __pyx_builtin_UserWarning = __Pyx_GetBuiltinName(__pyx_n_s_UserWarning); if (!__pyx_builtin_UserWarning) __PYX_ERR(4, 309, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(4, 324, __pyx_L1_error)
  __pyx_builtin_FutureWarning = __Pyx_GetBuiltinName(__pyx_n_s_FutureWarning); if (!__pyx_builtin_FutureWarning) __PYX_ERR(4, 785, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(4, 1001, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(4, 1475, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 1900, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(5, 79, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(5, 595, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(1, 60, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(6, 491, __pyx_L1_error)
  __pyx_builtin_BufferError = __Pyx_GetBuiltinName(__pyx_n_s_BufferError); if (!__pyx_builtin_BufferError) __PYX_ERR(6, 1025, __pyx_L1_error)
  __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(6, 1046, __pyx_L1_error)
  __pyx_builtin_EOFError = __Pyx_GetBuiltinName(__pyx_n_s_EOFError); if (!__pyx_builtin_EOFError) __PYX_ERR(7, 552, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pyarrow/lib.pyx":65
 *     """
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")             # <<<<<<<<<<<<<<
 *     check_status(SetCpuThreadPoolCapacity(count))
 * 
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_CPU_count_must_be_strictly_posit); if (unlikely(!__pyx_tuple_)) __PYX_ERR(8, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(tree fragment)":4
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_logging_pool_self_pool_cann); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(tree fragment)":4
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self_logging_pool_self_pool_cann); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "(tree fragment)":4
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pyarrow/types.pxi":127
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")             # <<<<<<<<<<<<<<
 *         return ty.bit_width()
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_fixed_width_type); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(4, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pyarrow/types.pxi":308
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             raise KeyError(name)
 */
  __pyx_tuple__14 = PyTuple_Pack(2, __pyx_kp_u_Struct_field_name_corresponds_to, __pyx_builtin_UserWarning); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(4, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pyarrow/types.pxi":336
 *             return self.child(i)
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Expected_integer_or_string_index); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pyarrow/types.pxi":548
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "ExtensionType")
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Can_only_instantiate_subclasses); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pyarrow/types.pxi":624
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "PyExtensionType")
 * 
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Can_only_instantiate_subclasses_2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "pyarrow/types.pxi":694
 * 
 *     if not isinstance(_type, BaseExtensionType):
 *         raise TypeError("Only extension types can be registered")             # <<<<<<<<<<<<<<
 * 
 *     # register on the C++ side
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Only_extension_types_can_be_regi); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(4, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pyarrow/types.pxi":731
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Field's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.field` instead.")
 * 
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Field_s_constructor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "pyarrow/types.pxi":784
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_tuple__20 = PyTuple_Pack(2, __pyx_kp_u_The_add_metadata_method_is_depre, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "pyarrow/types.pxi":806
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Metadata_must_be_an_instance_of); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "pyarrow/types.pxi":848
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Schema's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.schema` instead.")
 * 
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Schema_s_constructor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pyarrow/types.pxi":1026
 *             return self._field(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _field(self, int i):
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Index_must_either_be_string_or_i); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 1026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "pyarrow/types.pxi":1048
 *             vector[shared_ptr[CField]] results
 * 
 *         warnings.warn(             # <<<<<<<<<<<<<<
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)
 */
  __pyx_tuple__24 = PyTuple_Pack(2, __pyx_kp_u_The_field_by_name_method_is_depr, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "pyarrow/types.pxi":1056
 *             return None
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             return None
 */
  __pyx_tuple__25 = PyTuple_Pack(2, __pyx_kp_u_Schema_field_name_corresponds_to, __pyx_builtin_UserWarning); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "pyarrow/types.pxi":1151
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_kp_u_The_add_metadata_method_is_depre, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pyarrow/types.pxi":1434
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')             # <<<<<<<<<<<<<<
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_Offset_must_represent_whole_numb); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(4, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "pyarrow/types.pxi":1428
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */
  __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_offset, __pyx_n_s_seconds, __pyx_n_s_sign, __pyx_n_s_minutes, __pyx_n_s_hours); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(4, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_fixed_offset_to_string, 1428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(4, 1428, __pyx_L1_error)

  /* "pyarrow/types.pxi":1450
 *                              .format(tz))
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_Must_be_an_instance_of_datetime); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(4, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "pyarrow/types.pxi":1475
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))             # <<<<<<<<<<<<<<
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 */
  __pyx_tuple__33 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_3); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(4, 1475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "pyarrow/types.pxi":1517
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit string')             # <<<<<<<<<<<<<<
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Invalid_TimeUnit_string); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(4, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "pyarrow/types.pxi":1662
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")             # <<<<<<<<<<<<<<
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_precision_should_be_between_1_an); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(4, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "pyarrow/types.pxi":1750
 *         _field = value_type
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     list_type.reset(new CListType(_field.sp_field))
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_List_requires_DataType_or_Field); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(4, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "pyarrow/types.pxi":1812
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:
 *         raise TypeError("The dictionary index type should be signed integer.")             # <<<<<<<<<<<<<<
 * 
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_The_dictionary_index_type_should); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(4, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "pyarrow/types.pxi":2037
 *             py_field = item
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_field_or_tuple_expected_got_None); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(4, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "pyarrow/scalar.pxi":36
 *         global NA
 *         if NA is not None:
 *             raise Exception('Cannot create multiple NAType instances')             # <<<<<<<<<<<<<<
 * 
 *         self.type = null()
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_Cannot_create_multiple_NAType_in); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "pyarrow/scalar.pxi":93
 *             return self.as_py() == other
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_Cannot_compare_Arrow_values_that); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(5, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "pyarrow/scalar.pxi":229
 * 
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(days=ap.Value(self.index)))
 * 
 */
  __pyx_tuple__65 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "pyarrow/scalar.pxi":319
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "             # <<<<<<<<<<<<<<
 *                          " to microseconds to convert to datetime.datetime."
 *                          " Install pandas to return as Timestamp with "
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_u_Nanosecond_timestamp_is_not_safe); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(5, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "pyarrow/scalar.pxi":402
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_u_Cannot_convert_nanosecond_timest); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(5, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "pyarrow/scalar.pxi":859
 *             return self.as_py() == other
 *         else:
 *             raise NotImplemented(             # <<<<<<<<<<<<<<
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_u_Cannot_compare_scalars_that_don); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(5, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "pyarrow/array.pxi":89
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Cannot specify a mask or a size when passing an object that is "
 *             "converted with the __arrow_array__ protocol.")
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_u_Cannot_specify_a_mask_or_a_size); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "pyarrow/array.pxi":94
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, Array):
 *         raise TypeError("The object's __arrow_array__ method does not "             # <<<<<<<<<<<<<<
 *                         "return a pyarrow Array.")
 *     return res
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_kp_u_The_object_s___arrow_array___met); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(1, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "pyarrow/array.pxi":189
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "             # <<<<<<<<<<<<<<
 *                                  "specify a mask at the same time")
 *             else:
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pass_a_numpy_masked_array); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(1, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "pyarrow/array.pxi":292
 *     step = key.step or 1
 *     if step != 1:
 *         raise IndexError('only slices with step 1 supported')             # <<<<<<<<<<<<<<
 *     else:
 *         return arrow_obj.slice(start, stop - start)
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_u_only_slices_with_step_1_supporte); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "pyarrow/array.pxi":302
 *         index += length
 *         if index < 0:
 *             raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_u_index_out_of_bounds); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(1, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "pyarrow/array.pxi":329
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_u_Unable_to_wrap_Datum_in_a_Python); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(1, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "pyarrow/array.pxi":500
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_u_Comparisons_with_pyarrow_Array_a); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(1, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "pyarrow/array.pxi":808
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_u_Offset_must_be_non_negative); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(1, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "pyarrow/array.pxi":945
 *         """
 *         if self.null_count:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_u_NumPy_array_view_is_only_support); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(1, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "pyarrow/array.pxi":948
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for primitive types.')
 *         buflist = self.buffers()
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_u_NumPy_array_view_is_only_support_2); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(1, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "pyarrow/array.pxi":1473
 *         if isinstance(indices, Array):
 *             if mask is not None:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_u_mask_not_implemented_with_Arrow); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(1, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "pyarrow/array.pxi":1490
 * 
 *         if not isinstance(_indices, IntegerArray):
 *             raise ValueError('Indices must be integer type')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_bool c_ordered = ordered
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_u_Indices_must_be_integer_type); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(1, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "pyarrow/array.pxi":1604
 * 
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')             # <<<<<<<<<<<<<<
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_either_names_or_fields); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(1, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "pyarrow/array.pxi":1606
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')             # <<<<<<<<<<<<<<
 * 
 *         arrays = [asarray(x) for x in arrays]
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_either_names_or_fields_2); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(1, 1606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "pyarrow/builder.pxi":51
 *             self.builder.get().Append(tobytes(value))
 *         else:
 *             raise TypeError('StringBuilder only accepts string objects')             # <<<<<<<<<<<<<<
 * 
 *     def append_values(self, values):
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_u_StringBuilder_only_accepts_strin); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(11, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "pyarrow/table.pxi":33
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`chunked_array` function instead.")
 * 
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_ChunkedArray_s_const); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(12, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "pyarrow/table.pxi":46
 *     def data(self):
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "             # <<<<<<<<<<<<<<
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)
 */
  __pyx_tuple__149 = PyTuple_Pack(2, __pyx_kp_u_Calling_data_on_ChunkedArray_is, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(12, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "pyarrow/table.pxi":112
 *             return self.getitem(key)
 *         else:
 *             raise TypeError("key must either be a slice or integer")             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_u_key_must_either_be_a_slice_or_in); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(12, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "pyarrow/table.pxi":317
 *         """
 *         if i >= self.num_chunks or i < 0:
 *             raise IndexError('Chunk index out of range.')             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(self.chunked_array.chunk(i))
 */
  __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_u_Chunk_index_out_of_range); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(12, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "pyarrow/table.pxi":378
 *     else:
 *         if c_arrays.size() == 0:
 *             raise ValueError("Cannot construct a chunked array with neither "             # <<<<<<<<<<<<<<
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 */
  __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_u_Cannot_construct_a_chunked_array); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(12, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "pyarrow/table.pxi":408
 * 
 *     if names is None:
 *         raise ValueError('Must pass names or schema to Table.from_arrays')             # <<<<<<<<<<<<<<
 * 
 *     if len(names) != K:
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_names_or_schema_to_Tab); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(12, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "pyarrow/table.pxi":441
 *     else:
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')             # <<<<<<<<<<<<<<
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')
 */
  __pyx_tuple__154 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pass_both_schema_and_name); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(12, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "pyarrow/table.pxi":443
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')             # <<<<<<<<<<<<<<
 *         cy_schema = schema
 * 
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pass_both_schema_and_meta); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(12, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "pyarrow/table.pxi":447
 * 
 *         if len(schema) != len(arrays):
 *             raise ValueError('Schema and number of arrays unequal')             # <<<<<<<<<<<<<<
 * 
 *         c_schema[0] = cy_schema.sp_schema
 */
  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_kp_u_Schema_and_number_of_arrays_uneq); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(12, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "pyarrow/table.pxi":472
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 */
  __pyx_tuple__157 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_RecordBatch_s_constr); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(12, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "pyarrow/table.pxi":739
 *         if isinstance(names, Schema):
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "             # <<<<<<<<<<<<<<
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)
 */
  __pyx_tuple__158 = PyTuple_Pack(2, __pyx_kp_u_Schema_passed_to_names_option_pl, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(12, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "pyarrow/table.pxi":802
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Table's constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `Table.from_*` functions instead.")
 * 
 */
  __pyx_tuple__159 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Table_s_constructor); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(12, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "pyarrow/table.pxi":1179
 *         if schema is None:
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '             # <<<<<<<<<<<<<<
 *                                  'one RecordBatch')
 *             c_schema = c_batches[0].get().schema()
 */
  __pyx_tuple__160 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_schema_or_at_least_one); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(12, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);

  /* "pyarrow/table.pxi":1549
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 *         return TypeError("Expected pandas DataFrame or python dictionary")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__161 = PyTuple_Pack(1, __pyx_kp_u_Expected_pandas_DataFrame_or_pyt); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(12, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);

  /* "pyarrow/table.pxi":1592
 *     elif isinstance(data, dict):
 *         if names is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 */
  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_u_The_names_argument_is_not_valid); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(12, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "pyarrow/table.pxi":1597
 *     elif isinstance(data, _pandas_api.pd.DataFrame):
 *         if names is not None or metadata is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' and 'metadata' arguments are not valid when "
 *                 "passing a pandas DataFrame")
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_kp_u_The_names_and_metadata_arguments); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(12, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "pyarrow/tensor.pxi":25
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Tensor's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 */
  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Tensor_s_constructor); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(13, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__166 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);

  /* "pyarrow/tensor.pxi":135
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseTensorCOO's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseTensorCOO.from_*` "
 *                         "functions instead.")
 */
  __pyx_tuple__167 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_SparseTensorCOO_s_co); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(13, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "pyarrow/tensor.pxi":174
 *         coords = np.require(coords, dtype='i8', requirements='F')
 *         if coords.ndim != 2:
 *             raise ValueError("Expected 2-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseTensorCOO indices")
 * 
 */
  __pyx_tuple__168 = PyTuple_Pack(1, __pyx_kp_u_Expected_2_dimensional_array_for); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(13, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__169 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__170 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "pyarrow/tensor.pxi":252
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseTensorCSR's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseTensorCSR.from_*` "
 *                         "functions instead.")
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_SparseTensorCSR_s_co); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(13, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "pyarrow/tensor.pxi":292
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseTensorCSR indptr")
 *         if indices.ndim != 1:
 */
  __pyx_tuple__172 = PyTuple_Pack(1, __pyx_kp_u_Expected_1_dimensional_array_for); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(13, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);

  /* "pyarrow/tensor.pxi":295
 *                              "SparseTensorCSR indptr")
 *         if indices.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseTensorCSR indices")
 * 
 */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_kp_u_Expected_1_dimensional_array_for_2); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(13, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__174 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__175 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "pyarrow/io.pxi":95
 *             return 'wb'
 *         else:
 *             raise ValueError('File object is malformed, has no mode')             # <<<<<<<<<<<<<<
 * 
 *     def readable(self):
 */
  __pyx_tuple__176 = PyTuple_Pack(1, __pyx_kp_u_File_object_is_malformed_has_no); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(6, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);

  /* "pyarrow/io.pxi":164
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_kp_u_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(6, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "pyarrow/io.pxi":170
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_readonly_files); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(6, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "pyarrow/io.pxi":175
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_seekable(self):
 */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_writable_files); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(6, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "pyarrow/io.pxi":180
 *         self._assert_open()
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_seekable_files); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(6, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);

  /* "pyarrow/io.pxi":493
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_cleanup, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(6, 493, __pyx_L1_error)

  /* "pyarrow/io.pxi":498
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_cleanup, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(6, 498, __pyx_L1_error)

  /* "pyarrow/io.pxi":504
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__184 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(6, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);
  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(6, 504, __pyx_L1_error)

  /* "pyarrow/io.pxi":575
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__186 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(6, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(6, 575, __pyx_L1_error)

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__188 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__189 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);

  /* "pyarrow/io.pxi":662
 *                 if kind == 'r':
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if not handle.writable():
 */
  __pyx_tuple__190 = PyTuple_Pack(1, __pyx_kp_u_readable_file_expected); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(6, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);

  /* "pyarrow/io.pxi":665
 *                 else:
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 */
  __pyx_tuple__191 = PyTuple_Pack(1, __pyx_kp_u_writable_file_expected); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(6, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "pyarrow/io.pxi":678
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):
 *             raise TypeError("binary file expected, got text file")             # <<<<<<<<<<<<<<
 * 
 *         if kind == 'r':
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_u_binary_file_expected_got_text_fi); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(6, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__200 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);

  /* "pyarrow/io.pxi":892
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Buffer's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Buffer_s_constructor); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(6, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);

  /* "pyarrow/io.pxi":1025
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 *                 raise BufferError("Writable buffer requested but Arrow "             # <<<<<<<<<<<<<<
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 */
  __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_u_Writable_buffer_requested_but_Ar); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(6, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);

  /* "pyarrow/io.pxi":1046
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")             # <<<<<<<<<<<<<<
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 */
  __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_u_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(6, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);

  /* "pyarrow/io.pxi":1053
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */
  __pyx_tuple__204 = PyTuple_Pack(1, __pyx_kp_u_trying_to_write_an_immutable_buf); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(6, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);

  /* "pyarrow/io.pxi":1253
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         check_status(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
  __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_u_Buffer_size_must_be_larger_than); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(6, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "pyarrow/io.pxi":1378
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 *             raise ValueError("got null buffer")             # <<<<<<<<<<<<<<
 *     else:
 *         check_status(PyBuffer.FromPyObject(o, &buf))
 */
  __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_u_got_null_buffer); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(6, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);

  /* "pyarrow/io-hdfs.pxi":127
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')             # <<<<<<<<<<<<<<
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')
 */
  __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_u_HDFS_client_improperly_initializ); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(2, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);

  /* "pyarrow/io-hdfs.pxi":129
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')             # <<<<<<<<<<<<<<
 * 
 *     def exists(self, path):
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_u_HDFS_client_is_closed); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(2, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);

  /* "pyarrow/io-hdfs.pxi":402
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 *             raise Exception("Mode must be 'rb' (read), "             # <<<<<<<<<<<<<<
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 */
  __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_u_Mode_must_be_rb_read_wb_write_ne); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(2, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);

  /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
  __pyx_tuple__224 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);

  /* "(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_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);

  /* "(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_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__229 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__230 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__231 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__233 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__234 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__235 = PyTuple_Pack(1, __pyx_kp_s_self_writer_cannot_be_converted); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);

  /* "(tree fragment)":4
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__236 = PyTuple_Pack(1, __pyx_kp_s_self_writer_cannot_be_converted); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__238 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);

  /* "pyarrow/ipc.pxi":304
 *     def get_next_batch(self):
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '             # <<<<<<<<<<<<<<
 *                       'get_next_batch', FutureWarning)
 *         return self.read_next_batch()
 */
  __pyx_tuple__239 = PyTuple_Pack(2, __pyx_kp_u_Please_use_read_next_batch_inste, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(7, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__240 = PyTuple_Pack(1, __pyx_kp_s_self_reader_cannot_be_converted); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__240);
  __Pyx_GIVEREF(__pyx_tuple__240);

  /* "(tree fragment)":4
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__241 = PyTuple_Pack(1, __pyx_kp_s_self_reader_cannot_be_converted); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__242 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__242);
  __Pyx_GIVEREF(__pyx_tuple__242);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__243 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__244 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__244);
  __Pyx_GIVEREF(__pyx_tuple__244);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__245 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__246 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__247 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);

  /* "pyarrow/ipc.pxi":552
 * 
 *     if result.message == nullptr:
 *         raise EOFError("End of Arrow stream")             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__248 = PyTuple_Pack(1, __pyx_kp_u_End_of_Arrow_stream); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(7, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__248);
  __Pyx_GIVEREF(__pyx_tuple__248);

  /* "pyarrow/feather.pxi":55
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')             # <<<<<<<<<<<<<<
 *         else:
 *             self.num_rows = len(col)
 */
  __pyx_tuple__249 = PyTuple_Pack(1, __pyx_kp_u_prior_column_had_a_different_num); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(14, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__250 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__250);
  __Pyx_GIVEREF(__pyx_tuple__250);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__251 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__252 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__253 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__254 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);

  /* "(tree fragment)":4
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__255 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);

  /* "pyarrow/public-api.pxi":193
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
  __pyx_tuple__256 = PyTuple_Pack(1, __pyx_kp_u_Array_was_NULL); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(17, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);

  /* "pyarrow/public-api.pxi":198
 * 
 *     if data_type == NULL:
 *         raise ValueError('Array data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _array_classes[data_type.id()]
 */
  __pyx_tuple__257 = PyTuple_Pack(1, __pyx_kp_u_Array_data_type_was_NULL); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(17, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);

  /* "pyarrow/public-api.pxi":210
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('ChunkedArray was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
  __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_u_ChunkedArray_was_NULL); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(17, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);

  /* "pyarrow/public-api.pxi":215
 * 
 *     if data_type == NULL:
 *         raise ValueError('ChunkedArray data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 */
  __pyx_tuple__259 = PyTuple_Pack(1, __pyx_kp_u_ChunkedArray_data_type_was_NULL); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(17, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);

  /* "pyarrow/public-api.pxi":223
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 */
  __pyx_tuple__260 = PyTuple_Pack(1, __pyx_kp_u_Scalar_was_NULL); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(17, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);

  /* "pyarrow/public-api.pxi":228
 * 
 *     if data_type == NULL:
 *         raise ValueError('Scalar data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _scalar_classes[data_type.id()]
 */
  __pyx_tuple__261 = PyTuple_Pack(1, __pyx_kp_u_Scalar_data_type_was_NULL); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(17, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);

  /* "pyarrow/public-api.pxi":253
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 *         raise ValueError('Tensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 */
  __pyx_tuple__262 = PyTuple_Pack(1, __pyx_kp_u_Tensor_was_NULL); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(17, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);

  /* "pyarrow/public-api.pxi":275
 *         const shared_ptr[CSparseTensorCOO]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseTensorCOO was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseTensorCOO sparse_tensor = SparseTensorCOO.__new__(
 */
  __pyx_tuple__263 = PyTuple_Pack(1, __pyx_kp_u_SparseTensorCOO_was_NULL); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(17, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);

  /* "pyarrow/public-api.pxi":298
 *         const shared_ptr[CSparseTensorCSR]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseTensorCSR was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseTensorCSR sparse_tensor = SparseTensorCSR.__new__(
 */
  __pyx_tuple__264 = PyTuple_Pack(1, __pyx_kp_u_SparseTensorCSR_was_NULL); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(17, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);

  /* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */
  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_lib_pyx, __pyx_n_s_cpu_count, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(8, 47, __pyx_L1_error)

  /* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */
  __pyx_tuple__266 = PyTuple_Pack(2, __pyx_n_s_count, __pyx_n_s_count); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(8, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_lib_pyx, __pyx_n_s_set_cpu_count, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(8, 60, __pyx_L1_error)

  /* "pyarrow/error.pxi":40
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */
  __pyx_tuple__268 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);
  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_error_pxi, __pyx_n_s_str, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 40, __pyx_L1_error)

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */
  __pyx_tuple__270 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(10, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);
  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_default_memory_pool, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(10, 90, __pyx_L1_error)

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_tuple__272 = PyTuple_Pack(2, __pyx_n_s_parent, __pyx_n_s_out); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(10, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);
  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_proxy_memory_pool, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(10, 100, __pyx_L1_error)

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_tuple__274 = PyTuple_Pack(2, __pyx_n_s_parent, __pyx_n_s_out); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(10, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__274);
  __Pyx_GIVEREF(__pyx_tuple__274);
  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_logging_memory_pool, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(10, 111, __pyx_L1_error)

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_tuple__276 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(10, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__276);
  __Pyx_GIVEREF(__pyx_tuple__276);
  __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_set_memory_pool, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(10, 123, __pyx_L1_error)

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_tuple__278 = PyTuple_Pack(1, __pyx_n_s_enable); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(10, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);
  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_log_memory_allocations, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(10, 132, __pyx_L1_error)

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */
  __pyx_tuple__280 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_total_allocated_bytes, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(10, 147, __pyx_L1_error)

  /* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */
  __pyx_tuple__282 = PyTuple_Pack(1, __pyx_n_s_decay_ms); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(10, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_jemalloc_set_decay_ms, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(10, 156, __pyx_L1_error)

  /* "pyarrow/types.pxi":42
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 */
  __pyx_tuple__284 = PyTuple_Pack(1, __pyx_kp_u_datetime64_ns); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);

  /* "pyarrow/types.pxi":84
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_tuple__285 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_n_s_type); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(4, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);
  __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_primitive, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(4, 84, __pyx_L1_error)

  /* "pyarrow/types.pxi":675
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */
  __pyx_tuple__287 = PyTuple_Pack(2, __pyx_n_s_ext_type, __pyx_n_s_type_4); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(4, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_register_extension_type, 675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(4, 675, __pyx_L1_error)

  /* "pyarrow/types.pxi":704
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */
  __pyx_tuple__289 = PyTuple_Pack(2, __pyx_n_s_type_name, __pyx_n_s_c_type_name); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(4, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_unregister_extension_type, 704, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(4, 704, __pyx_L1_error)

  /* "pyarrow/types.pxi":1270
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_tuple__291 = PyTuple_Pack(7, __pyx_n_s_name, __pyx_n_s_type, __pyx_n_s_nullable, __pyx_n_s_metadata, __pyx_n_s_result, __pyx_n_s_type_4, __pyx_n_s_c_meta); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(4, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_field, 1270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(4, 1270, __pyx_L1_error)

  /* "pyarrow/types.pxi":1319
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_null, 1319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(4, 1319, __pyx_L1_error)

  /* "pyarrow/types.pxi":1326
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_bool, 1326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(4, 1326, __pyx_L1_error)

  /* "pyarrow/types.pxi":1333
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint8, 1333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(4, 1333, __pyx_L1_error)

  /* "pyarrow/types.pxi":1340
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int8, 1340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(4, 1340, __pyx_L1_error)

  /* "pyarrow/types.pxi":1347
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint16, 1347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(4, 1347, __pyx_L1_error)

  /* "pyarrow/types.pxi":1354
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int16, 1354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(4, 1354, __pyx_L1_error)

  /* "pyarrow/types.pxi":1361
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint32, 1361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(4, 1361, __pyx_L1_error)

  /* "pyarrow/types.pxi":1368
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int32, 1368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(4, 1368, __pyx_L1_error)

  /* "pyarrow/types.pxi":1375
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint64, 1375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(4, 1375, __pyx_L1_error)

  /* "pyarrow/types.pxi":1382
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int64, 1382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(4, 1382, __pyx_L1_error)

  /* "pyarrow/types.pxi":1404
 * 
 * 
 * _FIXED_OFFSET_RE = re.compile(r'([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__303 = PyTuple_Pack(1, __pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(4, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);

  /* "pyarrow/types.pxi":1407
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */
  __pyx_tuple__304 = PyTuple_Pack(5, __pyx_n_s_tz, __pyx_n_s_pytz, __pyx_n_s_datetime, __pyx_n_s_fixed_offset_to_string, __pyx_n_s_fixed_offset_to_string); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(4, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_tzinfo_to_string, 1407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(4, 1407, __pyx_L1_error)

  /* "pyarrow/types.pxi":1453
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */
  __pyx_tuple__306 = PyTuple_Pack(6, __pyx_n_s_name, __pyx_n_s_pytz, __pyx_n_s_m, __pyx_n_s_sign, __pyx_n_s_hours, __pyx_n_s_minutes); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(4, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_GIVEREF(__pyx_tuple__306);
  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_string_to_tzinfo, 1453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(4, 1453, __pyx_L1_error)

  /* "pyarrow/types.pxi":1481
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */
  __pyx_tuple__308 = PyTuple_Pack(5, __pyx_n_s_unit, __pyx_n_s_tz, __pyx_n_s_unit_code, __pyx_n_s_c_timezone, __pyx_n_s_out); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(4, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__308);
  __Pyx_GIVEREF(__pyx_tuple__308);
  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_timestamp, 1481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(4, 1481, __pyx_L1_error)

  /* "pyarrow/types.pxi":1536
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__310 = PyTuple_Pack(4, __pyx_n_s_unit, __pyx_n_s_unit_code, __pyx_n_s_c_timezone, __pyx_n_s_out); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(4, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__310);
  __Pyx_GIVEREF(__pyx_tuple__310);
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_time32, 1536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(4, 1536, __pyx_L1_error)

  /* "pyarrow/types.pxi":1574
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__312 = PyTuple_Pack(4, __pyx_n_s_unit, __pyx_n_s_unit_code, __pyx_n_s_c_timezone, __pyx_n_s_out); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(4, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__312);
  __Pyx_GIVEREF(__pyx_tuple__312);
  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_time64, 1574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(4, 1574, __pyx_L1_error)

  /* "pyarrow/types.pxi":1612
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_date32, 1612, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(4, 1612, __pyx_L1_error)

  /* "pyarrow/types.pxi":1619
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_date64, 1619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(4, 1619, __pyx_L1_error)

  /* "pyarrow/types.pxi":1626
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_float16, 1626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(4, 1626, __pyx_L1_error)

  /* "pyarrow/types.pxi":1633
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_float32, 1633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(4, 1633, __pyx_L1_error)

  /* "pyarrow/types.pxi":1640
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_float64, 1640, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(4, 1640, __pyx_L1_error)

  /* "pyarrow/types.pxi":1667
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_string, 1667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(4, 1667, __pyx_L1_error)

  /* "pyarrow/types.pxi":1674
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_utf8, 1674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(4, 1674, __pyx_L1_error)

  /* "pyarrow/types.pxi":1681
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_tuple__321 = PyTuple_Pack(2, __pyx_n_s_length, __pyx_n_s_fixed_size_binary_type); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(4, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_binary, 1681, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(4, 1681, __pyx_L1_error)

  /* "pyarrow/types.pxi":1700
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_large_binary, 1700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(4, 1700, __pyx_L1_error)

  /* "pyarrow/types.pxi":1710
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */
  __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_large_string, 1710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(4, 1710, __pyx_L1_error)

  /* "pyarrow/types.pxi":1720
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_large_utf8, 1720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(4, 1720, __pyx_L1_error)

  /* "pyarrow/types.pxi":1820
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_tuple__326 = PyTuple_Pack(5, __pyx_n_s_fields, __pyx_n_s_py_field, __pyx_n_s_c_fields, __pyx_n_s_struct_type, __pyx_n_s_item); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(4, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_struct, 1820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(4, 1820, __pyx_L1_error)

  /* "pyarrow/types.pxi":1868
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_tuple__328 = PyTuple_Pack(7, __pyx_n_s_children_fields, __pyx_n_s_mode, __pyx_n_s_child_field, __pyx_n_s_c_fields, __pyx_n_s_type_codes, __pyx_n_s_union_type, __pyx_n_s_i); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(4, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_union, 1868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(4, 1868, __pyx_L1_error)

  /* "pyarrow/types.pxi":1955
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),             # <<<<<<<<<<<<<<
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 */
  __pyx_tuple__330 = PyTuple_Pack(1, __pyx_n_u_s); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(4, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);

  /* "pyarrow/types.pxi":1956
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),             # <<<<<<<<<<<<<<
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 */
  __pyx_tuple__331 = PyTuple_Pack(1, __pyx_n_u_ms); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(4, 1956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__331);
  __Pyx_GIVEREF(__pyx_tuple__331);

  /* "pyarrow/types.pxi":1957
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),             # <<<<<<<<<<<<<<
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 */
  __pyx_tuple__332 = PyTuple_Pack(1, __pyx_n_u_us); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(4, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);

  /* "pyarrow/types.pxi":1958
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),             # <<<<<<<<<<<<<<
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 */
  __pyx_tuple__333 = PyTuple_Pack(1, __pyx_n_u_ns); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(4, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__333);
  __Pyx_GIVEREF(__pyx_tuple__333);

  /* "pyarrow/types.pxi":1966
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_tuple__334 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_alias); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(4, 1966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__334);
  __Pyx_GIVEREF(__pyx_tuple__334);
  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_type_for_alias, 1966, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) __PYX_ERR(4, 1966, __pyx_L1_error)

  /* "pyarrow/types.pxi":1996
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_tuple__336 = PyTuple_Pack(8, __pyx_n_s_fields, __pyx_n_s_metadata, __pyx_n_s_c_meta, __pyx_n_s_c_schema, __pyx_n_s_result, __pyx_n_s_py_field, __pyx_n_s_c_fields, __pyx_n_s_item); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(4, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__336);
  __Pyx_GIVEREF(__pyx_tuple__336);
  __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_schema, 1996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(4, 1996, __pyx_L1_error)

  /* "pyarrow/types.pxi":2052
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_tuple__338 = PyTuple_Pack(2, __pyx_n_s_dtype, __pyx_n_s_c_type); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(4, 2052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__338);
  __Pyx_GIVEREF(__pyx_tuple__338);
  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_from_numpy_dtype, 2052, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(4, 2052, __pyx_L1_error)

  /* "pyarrow/types.pxi":2064
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_tuple__340 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(4, 2064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__340);
  __Pyx_GIVEREF(__pyx_tuple__340);
  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_boolean_value, 2064, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(4, 2064, __pyx_L1_error)

  /* "pyarrow/types.pxi":2068
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_tuple__342 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(4, 2068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_integer_value, 2068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(4, 2068, __pyx_L1_error)

  /* "pyarrow/types.pxi":2072
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */
  __pyx_tuple__344 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(4, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_float_value, 2072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(4, 2072, __pyx_L1_error)

  /* "pyarrow/types.pxi":2091
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */
  __pyx_tuple__346 = PyTuple_Pack(3, __pyx_n_s_storage_type, __pyx_n_s_cpy_ext_type, __pyx_n_s_c_extension_name); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(4, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__346);
  __Pyx_GIVEREF(__pyx_tuple__346);
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__346, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_register_py_extension_type, 2091, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(4, 2091, __pyx_L1_error)

  /* "pyarrow/types.pxi":2106
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */
  __pyx_tuple__348 = PyTuple_Pack(1, __pyx_n_s_ext_type); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(4, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__348);
  __Pyx_GIVEREF(__pyx_tuple__348);
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_unregister_py_extension_types, 2106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(4, 2106, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */
  __pyx_tuple__350 = PyTuple_Pack(4, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_micros, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__350);
  __Pyx_GIVEREF(__pyx_tuple__350);
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_nanoseconds_to_datetime_safe, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) __PYX_ERR(5, 317, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */
  __pyx_tuple__352 = PyTuple_Pack(4, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_micros, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(5, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);
  __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_microseconds_to_datetime, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) __PYX_ERR(5, 330, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */
  __pyx_tuple__354 = PyTuple_Pack(4, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_millis, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(5, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__354);
  __Pyx_GIVEREF(__pyx_tuple__354);
  __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_millis_to_datetime, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) __PYX_ERR(5, 336, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */
  __pyx_tuple__356 = PyTuple_Pack(3, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(5, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__356);
  __Pyx_GIVEREF(__pyx_tuple__356);
  __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_seconds_to_datetime, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) __PYX_ERR(5, 342, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */
  __pyx_tuple__358 = PyTuple_Pack(1, __pyx_n_s_pd); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(5, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_datetime_conversion_functions, 347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(5, 347, __pyx_L1_error)

  /* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */
  __pyx_tuple__360 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_type); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);
  __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_ndarray_to_arrow_type, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) __PYX_ERR(1, 50, __pyx_L1_error)

  /* "pyarrow/array.pxi":87
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */
  __pyx_tuple__362 = PyTuple_Pack(5, __pyx_n_s_obj, __pyx_n_s_type, __pyx_n_s_mask, __pyx_n_s_size, __pyx_n_s_res); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__362);
  __Pyx_GIVEREF(__pyx_tuple__362);
  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_handle_arrow_array_protocol, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(1, 87, __pyx_L1_error)

  /* "pyarrow/array.pxi":99
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */
  __pyx_tuple__364 = PyTuple_Pack(11, __pyx_n_s_obj, __pyx_n_s_type, __pyx_n_s_mask, __pyx_n_s_size, __pyx_n_s_from_pandas, __pyx_n_s_safe, __pyx_n_s_memory_pool, __pyx_n_s_pool, __pyx_n_s_is_pandas_object, __pyx_n_s_c_from_pandas, __pyx_n_s_values); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(1, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__364);
  __Pyx_GIVEREF(__pyx_tuple__364);
  __pyx_codeobj__365 = (PyObject*)__Pyx_PyCode_New(7, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_array, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__365)) __PYX_ERR(1, 99, __pyx_L1_error)

  /* "pyarrow/array.pxi":214
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */
  __pyx_tuple__366 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_type); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__366);
  __Pyx_GIVEREF(__pyx_tuple__366);
  __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_asarray, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) __PYX_ERR(1, 214, __pyx_L1_error)

  /* "pyarrow/array.pxi":240
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */
  __pyx_tuple__368 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_from_pandas, __pyx_n_s_out, __pyx_n_s_use_pandas_sentinels); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__368);
  __Pyx_GIVEREF(__pyx_tuple__368);
  __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_infer_type, 240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) __PYX_ERR(1, 240, __pyx_L1_error)

  /* "pyarrow/array.pxi":269
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */
  __pyx_tuple__370 = PyTuple_Pack(6, __pyx_n_s_arrow_obj, __pyx_n_s_key, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_n); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(1, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__370);
  __Pyx_GIVEREF(__pyx_tuple__370);
  __pyx_codeobj__371 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__370, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_normalize_slice, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__371)) __PYX_ERR(1, 269, __pyx_L1_error)

  /* "pyarrow/array.pxi":404
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_tuple__372 = PyTuple_Pack(2, __pyx_n_s_data, __pyx_n_s_ad); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(1, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__372);
  __Pyx_GIVEREF(__pyx_tuple__372);
  __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__372, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_restore_array, 404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) __PYX_ERR(1, 404, __pyx_L1_error)

  /* "pyarrow/array.pxi":629
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
  __pyx_tuple__374 = PyTuple_Pack(5, __pyx_n_s_obj, __pyx_n_s_mask, __pyx_n_s_type, __pyx_n_s_safe, __pyx_n_s_memory_pool); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__374);
  __Pyx_GIVEREF(__pyx_tuple__374);
  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_pandas, 629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) __PYX_ERR(1, 629, __pyx_L1_error)

  /* "pyarrow/array.pxi":669
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */
  __pyx_tuple__376 = PyTuple_Pack(12, __pyx_n_s_type, __pyx_n_s_length, __pyx_n_s_buffers, __pyx_n_s_null_count, __pyx_n_s_offset, __pyx_n_s_children, __pyx_n_s_buf, __pyx_n_s_child, __pyx_n_s_c_buffers, __pyx_n_s_c_child_data, __pyx_n_s_array_data, __pyx_n_s_result); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(1, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) __PYX_ERR(1, 669, __pyx_L1_error)

  /* "pyarrow/array.pxi":1156
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */
  __pyx_tuple__378 = PyTuple_Pack(8, __pyx_n_s_offsets, __pyx_n_s_values, __pyx_n_s_pool, __pyx_n_s_offsets_2, __pyx_n_s_values_2, __pyx_n_s_out, __pyx_n_s_cpool, __pyx_n_s_result); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(1, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__378);
  __Pyx_GIVEREF(__pyx_tuple__378);
  __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) __PYX_ERR(1, 1156, __pyx_L1_error)

  /* "pyarrow/array.pxi":1209
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and values
 */
  __pyx_tuple__380 = PyTuple_Pack(8, __pyx_n_s_offsets, __pyx_n_s_values, __pyx_n_s_pool, __pyx_n_s_offsets_2, __pyx_n_s_values_2, __pyx_n_s_out, __pyx_n_s_cpool, __pyx_n_s_result); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(1, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__380);
  __Pyx_GIVEREF(__pyx_tuple__380);
  __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) __PYX_ERR(1, 1209, __pyx_L1_error)

  /* "pyarrow/array.pxi":1256
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */
  __pyx_tuple__382 = PyTuple_Pack(12, __pyx_n_s_types, __pyx_n_s_value_offsets, __pyx_n_s_children, __pyx_n_s_field_names, __pyx_n_s_type_codes, __pyx_n_s_out, __pyx_n_s_c, __pyx_n_s_child, __pyx_n_s_c_field_names, __pyx_n_s_c_type_codes, __pyx_n_s_x, __pyx_n_s_result); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(1, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__382);
  __Pyx_GIVEREF(__pyx_tuple__382);
  __pyx_codeobj__383 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__382, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_dense, 1256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__383)) __PYX_ERR(1, 1256, __pyx_L1_error)

  /* "pyarrow/array.pxi":1296
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */
  __pyx_tuple__384 = PyTuple_Pack(11, __pyx_n_s_types, __pyx_n_s_children, __pyx_n_s_field_names, __pyx_n_s_type_codes, __pyx_n_s_out, __pyx_n_s_c, __pyx_n_s_child, __pyx_n_s_c_field_names, __pyx_n_s_c_type_codes, __pyx_n_s_x, __pyx_n_s_result); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(1, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__384);
  __Pyx_GIVEREF(__pyx_tuple__384);
  __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_sparse, 1296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) __PYX_ERR(1, 1296, __pyx_L1_error)

  /* "pyarrow/array.pxi":1342
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_tuple__386 = PyTuple_Pack(6, __pyx_n_s_length, __pyx_n_s_value_offsets, __pyx_n_s_data, __pyx_n_s_null_bitmap, __pyx_n_s_null_count, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(1, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__386);
  __Pyx_GIVEREF(__pyx_tuple__386);
  __pyx_codeobj__387 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__386, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__387)) __PYX_ERR(1, 1342, __pyx_L1_error)

  /* "pyarrow/array.pxi":1374
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_tuple__388 = PyTuple_Pack(6, __pyx_n_s_length, __pyx_n_s_value_offsets, __pyx_n_s_data, __pyx_n_s_null_bitmap, __pyx_n_s_null_count, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(1, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__388);
  __Pyx_GIVEREF(__pyx_tuple__388);
  __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__388, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 1374, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) __PYX_ERR(1, 1374, __pyx_L1_error)

  /* "pyarrow/array.pxi":1439
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __pyx_tuple__390 = PyTuple_Pack(13, __pyx_n_s_indices, __pyx_n_s_dictionary, __pyx_n_s_mask, __pyx_n_s_ordered, __pyx_n_s_from_pandas, __pyx_n_s_safe, __pyx_n_s_memory_pool, __pyx_n_s_indices_2, __pyx_n_s_dictionary_2, __pyx_n_s_c_type, __pyx_n_s_c_result, __pyx_n_s_c_ordered, __pyx_n_s_result); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__390);
  __Pyx_GIVEREF(__pyx_tuple__390);
  __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(7, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__390, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) __PYX_ERR(1, 1439, __pyx_L1_error)

  /* "pyarrow/array.pxi":1572
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */
  __pyx_tuple__392 = PyTuple_Pack(18, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_fields, __pyx_n_s_c_array, __pyx_n_s_c_arrays, __pyx_n_s_c_names, __pyx_n_s_c_fields, __pyx_n_s_c_result, __pyx_n_s_num_arrays, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_py_field, __pyx_n_s_struct_type, __pyx_n_s_arr, __pyx_n_s_name, __pyx_n_s_item, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(1, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__392);
  __Pyx_GIVEREF(__pyx_tuple__392);
  __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(3, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__392, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) __PYX_ERR(1, 1572, __pyx_L1_error)

  /* "pyarrow/array.pxi":1653
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */
  __pyx_tuple__394 = PyTuple_Pack(4, __pyx_n_s_typ, __pyx_n_s_storage, __pyx_n_s_ext_array, __pyx_n_s_result); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(1, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__394);
  __Pyx_GIVEREF(__pyx_tuple__394);
  __pyx_codeobj__395 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__394, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_storage, 1653, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__395)) __PYX_ERR(1, 1653, __pyx_L1_error)

  /* "pyarrow/array.pxi":1729
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */
  __pyx_tuple__396 = PyTuple_Pack(6, __pyx_n_s_arrays, __pyx_n_s_memory_pool, __pyx_n_s_c_arrays, __pyx_n_s_c_result, __pyx_n_s_array, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(1, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__396);
  __Pyx_GIVEREF(__pyx_tuple__396);
  __pyx_codeobj__397 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__396, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_concat_arrays, 1729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) __PYX_ERR(1, 1729, __pyx_L1_error)

  /* "pyarrow/table.pxi":339
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_tuple__398 = PyTuple_Pack(7, __pyx_n_s_arrays, __pyx_n_s_type, __pyx_n_s_arr, __pyx_n_s_c_arrays, __pyx_n_s_sp_chunked_array, __pyx_n_s_sp_data_type, __pyx_n_s_x); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(12, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__398);
  __Pyx_GIVEREF(__pyx_tuple__398);
  __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_chunked_array, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) __PYX_ERR(12, 339, __pyx_L1_error)

  /* "pyarrow/table.pxi":707
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_tuple__400 = PyTuple_Pack(11, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata, __pyx_n_s_arr, __pyx_n_s_c_schema, __pyx_n_s_c_arrays, __pyx_n_s_num_rows, __pyx_n_s_warnings, __pyx_n_s_converted_arrays, __pyx_n_s_result); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(12, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__400);
  __Pyx_GIVEREF(__pyx_tuple__400);
  __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_arrays, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) __PYX_ERR(12, 707, __pyx_L1_error)

  /* "pyarrow/table.pxi":761
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_tuple__402 = PyTuple_Pack(2, __pyx_n_s_columns, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(12, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__402);
  __Pyx_GIVEREF(__pyx_tuple__402);
  __pyx_codeobj__403 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__402, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_reconstruct_record_batch, 761, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__403)) __PYX_ERR(12, 761, __pyx_L1_error)

  /* "pyarrow/table.pxi":768
 * 
 * 
 * def table_to_blocks(options, Table table, categories):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */
  __pyx_tuple__404 = PyTuple_Pack(9, __pyx_n_s_options, __pyx_n_s_table, __pyx_n_s_categories, __pyx_n_s_result_obj, __pyx_n_s_c_table, __pyx_n_s_pool, __pyx_n_s_categorical_columns, __pyx_n_s_c_options, __pyx_n_s_cat); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(12, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__404);
  __Pyx_GIVEREF(__pyx_tuple__404);
  __pyx_codeobj__405 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__404, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_table_to_blocks, 768, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__405)) __PYX_ERR(12, 768, __pyx_L1_error)

  /* "pyarrow/table.pxi":1068
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */
  __pyx_tuple__406 = PyTuple_Pack(11, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata, __pyx_n_s_columns, __pyx_n_s_c_schema, __pyx_n_s_i, __pyx_n_s_K, __pyx_n_s_converted_arrays, __pyx_n_s_item, __pyx_n_s_result); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(12, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__406);
  __Pyx_GIVEREF(__pyx_tuple__406);
  __pyx_codeobj__407 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__406, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_arrays, 1068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__407)) __PYX_ERR(12, 1068, __pyx_L1_error)

  /* "pyarrow/table.pxi":1114
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_tuple__408 = PyTuple_Pack(10, __pyx_n_s_mapping, __pyx_n_s_schema, __pyx_n_s_metadata, __pyx_n_s_arrays, __pyx_n_s_field, __pyx_n_s_v, __pyx_n_s_e, __pyx_n_s_e2, __pyx_n_s_names, __pyx_n_s_k); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(12, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__408);
  __Pyx_GIVEREF(__pyx_tuple__408);
  __pyx_codeobj__409 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__408, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_pydict, 1114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__409)) __PYX_ERR(12, 1114, __pyx_L1_error)

  /* "pyarrow/table.pxi":1153
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */
  __pyx_tuple__410 = PyTuple_Pack(6, __pyx_n_s_batches, __pyx_n_s_schema, __pyx_n_s_c_batches, __pyx_n_s_c_table, __pyx_n_s_c_schema, __pyx_n_s_batch); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(12, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__410);
  __Pyx_GIVEREF(__pyx_tuple__410);
  __pyx_codeobj__411 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__410, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_batches, 1153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__411)) __PYX_ERR(12, 1153, __pyx_L1_error)

  /* "pyarrow/table.pxi":1504
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_tuple__412 = PyTuple_Pack(2, __pyx_n_s_arrays, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(12, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__412);
  __Pyx_GIVEREF(__pyx_tuple__412);
  __pyx_codeobj__413 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__412, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_reconstruct_table, 1504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__413)) __PYX_ERR(12, 1504, __pyx_L1_error)

  /* "pyarrow/table.pxi":1511
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */
  __pyx_tuple__414 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(12, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__414);
  __Pyx_GIVEREF(__pyx_tuple__414);
  __pyx_codeobj__415 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__414, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_record_batch, 1511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__415)) __PYX_ERR(12, 1511, __pyx_L1_error)

  /* "pyarrow/table.pxi":1552
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */
  __pyx_tuple__416 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(12, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__416);
  __Pyx_GIVEREF(__pyx_tuple__416);
  __pyx_codeobj__417 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__416, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_table, 1552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__417)) __PYX_ERR(12, 1552, __pyx_L1_error)

  /* "pyarrow/table.pxi":1605
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */
  __pyx_tuple__418 = PyTuple_Pack(4, __pyx_n_s_tables, __pyx_n_s_c_tables, __pyx_n_s_c_result, __pyx_n_s_table); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(12, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__418);
  __Pyx_GIVEREF(__pyx_tuple__418);
  __pyx_codeobj__419 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__418, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_concat_tables, 1605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__419)) __PYX_ERR(12, 1605, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */
  __pyx_tuple__420 = PyTuple_Pack(5, __pyx_n_s_obj, __pyx_n_s_dim_names, __pyx_n_s_c_dim_names, __pyx_n_s_ctensor, __pyx_n_s_x); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__420);
  __Pyx_GIVEREF(__pyx_tuple__420);
  __pyx_codeobj__421 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__420, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_numpy, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__421)) __PYX_ERR(13, 40, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCOO from numpy.ndarrays
 */
  __pyx_tuple__422 = PyTuple_Pack(8, __pyx_n_s_data, __pyx_n_s_coords, __pyx_n_s_shape, __pyx_n_s_dim_names, __pyx_n_s_csparse_tensor, __pyx_n_s_c_shape, __pyx_n_s_c_dim_names, __pyx_n_s_x); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__422);
  __Pyx_GIVEREF(__pyx_tuple__422);
  __pyx_codeobj__423 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__422, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_numpy, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__423)) __PYX_ERR(13, 157, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":182
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCOO
 */
  __pyx_tuple__424 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_csparse_tensor, __pyx_n_s_ctensor); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(13, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__424);
  __Pyx_GIVEREF(__pyx_tuple__424);
  __pyx_codeobj__425 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__424, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_tensor, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__425)) __PYX_ERR(13, 182, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":274
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCSR from numpy.ndarrays
 */
  __pyx_tuple__426 = PyTuple_Pack(9, __pyx_n_s_data, __pyx_n_s_indptr, __pyx_n_s_indices, __pyx_n_s_shape, __pyx_n_s_dim_names, __pyx_n_s_csparse_tensor, __pyx_n_s_c_shape, __pyx_n_s_c_dim_names, __pyx_n_s_x); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__426);
  __Pyx_GIVEREF(__pyx_tuple__426);
  __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_numpy, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) __PYX_ERR(13, 274, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":304
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCSR
 */
  __pyx_tuple__428 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_csparse_tensor, __pyx_n_s_ctensor); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(13, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__428);
  __Pyx_GIVEREF(__pyx_tuple__428);
  __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__428, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_tensor, 304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) __PYX_ERR(13, 304, __pyx_L1_error)

  /* "pyarrow/io.pxi":710
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */
  __pyx_tuple__430 = PyTuple_Pack(6, __pyx_n_s_path, __pyx_n_s_size, __pyx_n_s_handle, __pyx_n_s_c_path, __pyx_n_s_c_size, __pyx_n_s_result); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(6, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__430);
  __Pyx_GIVEREF(__pyx_tuple__430);
  __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_create, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) __PYX_ERR(6, 710, __pyx_L1_error)

  /* "pyarrow/io.pxi":772
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_tuple__432 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_mode, __pyx_n_s_mmap); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(6, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__432);
  __Pyx_GIVEREF(__pyx_tuple__432);
  __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_memory_map, 772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) __PYX_ERR(6, 772, __pyx_L1_error)

  /* "pyarrow/io.pxi":792
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */
  __pyx_tuple__434 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_size); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(6, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__434);
  __Pyx_GIVEREF(__pyx_tuple__434);
  __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_create_memory_map, 792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) __PYX_ERR(6, 792, __pyx_L1_error)

  /* "pyarrow/io.pxi":1095
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_tuple__436 = PyTuple_Pack(6, __pyx_n_s_size, __pyx_n_s_memory_pool, __pyx_n_s_resizable, __pyx_n_s_buffer, __pyx_n_s_rz_buffer, __pyx_n_s_cpool); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(6, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__436);
  __Pyx_GIVEREF(__pyx_tuple__436);
  __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_allocate_buffer, 1095, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) __PYX_ERR(6, 1095, __pyx_L1_error)

  /* "pyarrow/io.pxi":1339
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */
  __pyx_tuple__438 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(6, 1339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__438);
  __Pyx_GIVEREF(__pyx_tuple__438);
  __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_py_buffer, 1339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) __PYX_ERR(6, 1339, __pyx_L1_error)

  /* "pyarrow/io.pxi":1348
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_tuple__440 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_size, __pyx_n_s_base, __pyx_n_s_c_addr, __pyx_n_s_c_size, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(6, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__440);
  __Pyx_GIVEREF(__pyx_tuple__440);
  __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__440, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_foreign_buffer, 1348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) __PYX_ERR(6, 1348, __pyx_L1_error)

  /* "pyarrow/io.pxi":1367
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_tuple__442 = PyTuple_Pack(1, __pyx_n_s_o); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(6, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__442);
  __Pyx_GIVEREF(__pyx_tuple__442);
  __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_as_buffer, 1367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) __PYX_ERR(6, 1367, __pyx_L1_error)

  /* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */
  __pyx_tuple__444 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(6, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__444);
  __Pyx_GIVEREF(__pyx_tuple__444);
  __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__444, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_detect_compression, 1484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) __PYX_ERR(6, 1484, __pyx_L1_error)

  /* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */
  __pyx_tuple__446 = PyTuple_Pack(13, __pyx_n_s_buf, __pyx_n_s_codec, __pyx_n_s_asbytes, __pyx_n_s_memory_pool, __pyx_n_s_c_codec, __pyx_n_s_compressor, __pyx_n_s_owned_buf, __pyx_n_s_c_buf, __pyx_n_s_pyobj, __pyx_n_s_out_buf, __pyx_n_s_max_output_size, __pyx_n_s_output_buffer, __pyx_n_s_output_length); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(6, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__446);
  __Pyx_GIVEREF(__pyx_tuple__446);
  __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_compress, 1496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) __PYX_ERR(6, 1496, __pyx_L1_error)

  /* "pyarrow/io.pxi":1557
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_tuple__448 = PyTuple_Pack(13, __pyx_n_s_buf, __pyx_n_s_decompressed_size, __pyx_n_s_codec, __pyx_n_s_asbytes, __pyx_n_s_memory_pool, __pyx_n_s_c_codec, __pyx_n_s_compressor, __pyx_n_s_owned_buf, __pyx_n_s_c_buf, __pyx_n_s_out_buf, __pyx_n_s_output_size, __pyx_n_s_output_buffer, __pyx_n_s_pybuf); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(6, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__448);
  __Pyx_GIVEREF(__pyx_tuple__448);
  __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_decompress, 1557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) __PYX_ERR(6, 1557, __pyx_L1_error)

  /* "pyarrow/io.pxi":1615
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */
  __pyx_tuple__450 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_compression, __pyx_n_s_buffer_size, __pyx_n_s_stream, __pyx_n_s_source_path); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(6, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__450);
  __Pyx_GIVEREF(__pyx_tuple__450);
  __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_input_stream, 1615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) __PYX_ERR(6, 1615, __pyx_L1_error)

  /* "pyarrow/io.pxi":1667
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */
  __pyx_tuple__452 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_compression, __pyx_n_s_buffer_size, __pyx_n_s_stream, __pyx_n_s_source_path); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(6, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__452);
  __Pyx_GIVEREF(__pyx_tuple__452);
  __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_output_stream, 1667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) __PYX_ERR(6, 1667, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_tuple__454 = PyTuple_Pack(1, __pyx_kp_u_hdfs_d); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__454);
  __Pyx_GIVEREF(__pyx_tuple__454);

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_codeobj__455 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_n_s_have_libhdfs, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__455)) __PYX_ERR(2, 30, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_codeobj__456 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_n_s_have_libhdfs3, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__456)) __PYX_ERR(2, 39, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */
  __pyx_tuple__457 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_m); if (unlikely(!__pyx_tuple__457)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__457);
  __Pyx_GIVEREF(__pyx_tuple__457);
  __pyx_codeobj__458 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__457, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_n_s_strip_hdfs_abspath, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__458)) __PYX_ERR(2, 48, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":138
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */
  __pyx_tuple__459 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_in_stream, __pyx_n_s_reader); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(7, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__459);
  __Pyx_GIVEREF(__pyx_tuple__459);
  __pyx_codeobj__460 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__459, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_open_stream, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__460)) __PYX_ERR(7, 138, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":441
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */
  __pyx_tuple__461 = PyTuple_Pack(2, __pyx_n_s_tensor, __pyx_n_s_size); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(7, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__461);
  __Pyx_GIVEREF(__pyx_tuple__461);
  __pyx_codeobj__462 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__461, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_get_tensor_size, 441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__462)) __PYX_ERR(7, 441, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":451
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */
  __pyx_tuple__463 = PyTuple_Pack(2, __pyx_n_s_batch, __pyx_n_s_size); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__463);
  __Pyx_GIVEREF(__pyx_tuple__463);
  __pyx_codeobj__464 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__463, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_get_record_batch_size, 451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__464)) __PYX_ERR(7, 451, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":461
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */
  __pyx_tuple__465 = PyTuple_Pack(5, __pyx_n_s_tensor, __pyx_n_s_dest, __pyx_n_s_metadata_length, __pyx_n_s_body_length, __pyx_n_s_handle); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(7, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__465);
  __Pyx_GIVEREF(__pyx_tuple__465);
  __pyx_codeobj__466 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__465, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_write_tensor, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__466)) __PYX_ERR(7, 461, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":502
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */
  __pyx_tuple__467 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_sp_tensor, __pyx_n_s_c_stream, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(7, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__467);
  __Pyx_GIVEREF(__pyx_tuple__467);
  __pyx_codeobj__468 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__467, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_tensor, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__468)) __PYX_ERR(7, 502, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":529
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_tuple__469 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_c_stream, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(7, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__469);
  __Pyx_GIVEREF(__pyx_tuple__469);
  __pyx_codeobj__470 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__469, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_message, 529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__470)) __PYX_ERR(7, 529, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":557
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_tuple__471 = PyTuple_Pack(6, __pyx_n_s_obj, __pyx_n_s_dictionary_memo, __pyx_n_s_result, __pyx_n_s_cpp_file, __pyx_n_s_temp_memo, __pyx_n_s_arg_dict_memo); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(7, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__471);
  __Pyx_GIVEREF(__pyx_tuple__471);
  __pyx_codeobj__472 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_schema, 557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__472)) __PYX_ERR(7, 557, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":594
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */
  __pyx_tuple__473 = PyTuple_Pack(7, __pyx_n_s_obj, __pyx_n_s_schema, __pyx_n_s_dictionary_memo, __pyx_n_s_result, __pyx_n_s_message, __pyx_n_s_temp_memo, __pyx_n_s_arg_dict_memo); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(7, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__473);
  __Pyx_GIVEREF(__pyx_tuple__473);
  __pyx_codeobj__474 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__473, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_record_batch, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__474)) __PYX_ERR(7, 594, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_tuple__475 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_b, __pyx_n_s_f, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(15, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__475);
  __Pyx_GIVEREF(__pyx_tuple__475);
  __pyx_codeobj__476 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__475, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_is_named_tuple, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__476)) __PYX_ERR(15, 25, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_tuple__477 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_example_object); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(15, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__477);
  __Pyx_GIVEREF(__pyx_tuple__477);
  __pyx_codeobj__478 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__478)) __PYX_ERR(15, 37, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_tuple__479 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_type_id); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(15, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__479);
  __Pyx_GIVEREF(__pyx_tuple__479);
  __pyx_codeobj__480 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__479, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__480)) __PYX_ERR(15, 43, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */
  __pyx_tuple__481 = PyTuple_Pack(1, __pyx_n_s_register_default_serialization_h); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(15, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__481);
  __Pyx_GIVEREF(__pyx_tuple__481);
  __pyx_codeobj__482 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_get_default_context, 226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__482)) __PYX_ERR(15, 226, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_tuple__483 = PyTuple_Pack(6, __pyx_n_s_components, __pyx_n_s_num_tensors, __pyx_n_s_num_ndarrays, __pyx_n_s_num_buffers, __pyx_n_s_buffers, __pyx_n_s_result); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(15, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__483);
  __Pyx_GIVEREF(__pyx_tuple__483);
  __pyx_codeobj__484 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__483, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_from_components, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__484)) __PYX_ERR(15, 294, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":336
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */
  __pyx_tuple__485 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_context, __pyx_n_s_serialized, __pyx_n_s_wrapped_value); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(15, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__485);
  __Pyx_GIVEREF(__pyx_tuple__485);
  __pyx_codeobj__486 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__485, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_serialize, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__486)) __PYX_ERR(15, 336, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":370
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */
  __pyx_tuple__487 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_sink, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(15, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__487);
  __Pyx_GIVEREF(__pyx_tuple__487);
  __pyx_codeobj__488 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__487, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_serialize_to, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__488)) __PYX_ERR(15, 370, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":387
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_tuple__489 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_stream, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(15, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__489);
  __Pyx_GIVEREF(__pyx_tuple__489);
  __pyx_codeobj__490 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__489, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_read_serialized, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__490)) __PYX_ERR(15, 387, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":413
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */
  __pyx_tuple__491 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(15, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__491);
  __Pyx_GIVEREF(__pyx_tuple__491);
  __pyx_codeobj__492 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__491, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize_from, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__492)) __PYX_ERR(15, 413, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":436
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */
  __pyx_tuple__493 = PyTuple_Pack(3, __pyx_n_s_components, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__493)) __PYX_ERR(15, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__493);
  __Pyx_GIVEREF(__pyx_tuple__493);
  __pyx_codeobj__494 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__493, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize_components, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__494)) __PYX_ERR(15, 436, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":454
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */
  __pyx_tuple__495 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_context, __pyx_n_s_source); if (unlikely(!__pyx_tuple__495)) __PYX_ERR(15, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__495);
  __Pyx_GIVEREF(__pyx_tuple__495);
  __pyx_codeobj__496 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__495, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__496)) __PYX_ERR(15, 454, __pyx_L1_error)

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */
  __pyx_tuple__497 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__497);
  __Pyx_GIVEREF(__pyx_tuple__497);
  __pyx_codeobj__498 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__497, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_benchmark_pxi, __pyx_n_s_benchmark_PandasObjectIsNull, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__498)) __PYX_ERR(16, 19, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__499 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__499);
  __Pyx_GIVEREF(__pyx_tuple__499);
  __pyx_codeobj__500 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__499, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__PandasAPIShim, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__500)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_tuple__501 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__501);
  __Pyx_GIVEREF(__pyx_tuple__501);
  __pyx_codeobj__502 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__501, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Scalar, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__502)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_tuple__503 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__503);
  __Pyx_GIVEREF(__pyx_tuple__503);
  __pyx_codeobj__504 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__503, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__PandasConvertibl, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__504)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_tuple__505 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__505);
  __Pyx_GIVEREF(__pyx_tuple__505);
  __pyx_codeobj__506 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__505, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SerializationCont, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__506)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(8, 1, __pyx_L1_error);
  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1970 = PyInt_FromLong(1970); if (unlikely(!__pyx_int_1970)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_93969614 = PyInt_FromLong(93969614L); if (unlikely(!__pyx_int_93969614)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_162458991 = PyInt_FromLong(162458991L); if (unlikely(!__pyx_int_162458991)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_261329190 = PyInt_FromLong(261329190L); if (unlikely(!__pyx_int_261329190)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_7pyarrow_3lib_pandas_api = ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__default_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__logging_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__pandas_type_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__pep3118_type_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__timestamp_type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__time_type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__type_aliases = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__array_value_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__scalar_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__global_ctx = ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__array_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("check_status", (void (*)(void))__pyx_f_7pyarrow_3lib_check_status, "int (arrow::Status const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("maybe_unbox_memory_pool", (void (*)(void))__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool, " arrow::MemoryPool *(struct __pyx_obj_7pyarrow_3lib_MemoryPool *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("wrap_array_output", (void (*)(void))__pyx_f_7pyarrow_3lib_wrap_array_output, "PyObject *(PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("box_scalar", (void (*)(void))__pyx_f_7pyarrow_3lib_box_scalar, "PyObject *(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_input_stream", (void (*)(void))__pyx_f_7pyarrow_3lib_get_input_stream, "PyObject *(PyObject *, bool, std::shared_ptr<arrow::io::InputStream>  *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_reader", (void (*)(void))__pyx_f_7pyarrow_3lib_get_reader, "PyObject *(PyObject *, bool, std::shared_ptr<arrow::io::RandomAccessFile>  *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_writer", (void (*)(void))__pyx_f_7pyarrow_3lib_get_writer, "PyObject *(PyObject *, std::shared_ptr<arrow::io::OutputStream>  *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ensure_type", (void (*)(void))__pyx_f_7pyarrow_3lib_ensure_type, "struct __pyx_obj_7pyarrow_3lib_DataType *(PyObject *, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_metadata", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata, "std::shared_ptr< arrow::KeyValueMetadata>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_metadata", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata, "PyObject *(std::shared_ptr< arrow::KeyValueMetadata const >  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_array, "PyObject *(std::shared_ptr< arrow::Array>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_chunked_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array, "PyObject *(std::shared_ptr< arrow::ChunkedArray>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_batch", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch, "PyObject *(std::shared_ptr< arrow::RecordBatch>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer, "PyObject *(std::shared_ptr< arrow::Buffer>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_data_type", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type, "PyObject *(std::shared_ptr< arrow::DataType>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_field", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_field, "PyObject *(std::shared_ptr< arrow::Field>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_resizable_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer, "PyObject *(std::shared_ptr< arrow::ResizableBuffer>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_schema", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema, "PyObject *(std::shared_ptr< arrow::Schema>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_table", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_table, "PyObject *(std::shared_ptr< arrow::Table>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor, "PyObject *(std::shared_ptr< arrow::Tensor>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_sparse_tensor_coo", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_coo, "PyObject *(std::shared_ptr< arrow::SparseTensorCOO>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_sparse_tensor_csr", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_tensor_csr, "PyObject *(std::shared_ptr< arrow::SparseTensorCSR>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_array, "std::shared_ptr< arrow::Array>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_batch", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch, "std::shared_ptr< arrow::RecordBatch>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer, "std::shared_ptr< arrow::Buffer>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_data_type", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type, "std::shared_ptr< arrow::DataType>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_field", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_field, "std::shared_ptr< arrow::Field>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_schema", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema, "std::shared_ptr< arrow::Schema>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_table", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_table, "std::shared_ptr< arrow::Table>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor, "std::shared_ptr< arrow::Tensor>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_sparse_tensor_coo", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_tensor_coo, "std::shared_ptr< arrow::SparseTensorCOO>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_sparse_tensor_csr", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_tensor_csr, "std::shared_ptr< arrow::SparseTensorCSR>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_internal_check_status", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_internal_check_status, "int (arrow::Status const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_buffer, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_data_type", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_data_type, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_field", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_field, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_schema", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_schema, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_array, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_scalar", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar, "PyObject *(std::shared_ptr< arrow::Scalar>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_tensor, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_sparse_tensor_coo", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_coo, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_sparse_tensor_csr", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_tensor_csr, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_table", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_table, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_batch", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_batch, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(7, 20, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Message.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Message.tp_dictoffset && __pyx_type_7pyarrow_3lib_Message.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Message.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Message, (PyObject *)&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(7, 20, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(7, 20, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Message = &__pyx_type_7pyarrow_3lib_Message;
  __pyx_vtabptr_7pyarrow_3lib_MemoryPool = &__pyx_vtable_7pyarrow_3lib_MemoryPool;
  __pyx_vtable_7pyarrow_3lib_MemoryPool.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_MemoryPool *,  arrow::MemoryPool *))__pyx_f_7pyarrow_3lib_10MemoryPool_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(10, 23, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_MemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(10, 23, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(10, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(10, 23, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MemoryPool = &__pyx_type_7pyarrow_3lib_MemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_DataType = &__pyx_vtable_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_DataType.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_8DataType_init;
  __pyx_vtable_7pyarrow_3lib_DataType.child = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_DataType *, int))__pyx_f_7pyarrow_3lib_8DataType_child;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 94, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DataType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DataType.tp_dictoffset && __pyx_type_7pyarrow_3lib_DataType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DataType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DataType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 94, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DataType, (PyObject *)&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 94, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DataType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DataType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DataType, __weakref__);
  __pyx_ptype_7pyarrow_3lib_DataType = &__pyx_type_7pyarrow_3lib_DataType;
  __pyx_vtabptr_7pyarrow_3lib_ListType = &__pyx_vtable_7pyarrow_3lib_ListType;
  __pyx_vtable_7pyarrow_3lib_ListType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_ListType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_8ListType_init;
  __pyx_type_7pyarrow_3lib_ListType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 242, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListType.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 242, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListType, (PyObject *)&__pyx_type_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 242, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ListType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ListType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ListType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ListType = &__pyx_type_7pyarrow_3lib_ListType;
  __pyx_vtabptr_7pyarrow_3lib_LargeListType = &__pyx_vtable_7pyarrow_3lib_LargeListType;
  __pyx_vtable_7pyarrow_3lib_LargeListType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_LargeListType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_13LargeListType_init;
  __pyx_type_7pyarrow_3lib_LargeListType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeListType) < 0) __PYX_ERR(4, 262, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeListType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeListType.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeListType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeListType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeListType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeListType) < 0) __PYX_ERR(4, 262, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeListType, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeListType) < 0) __PYX_ERR(4, 262, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeListType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeListType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeListType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeListType = &__pyx_type_7pyarrow_3lib_LargeListType;
  __pyx_vtabptr_7pyarrow_3lib_StructType = &__pyx_vtable_7pyarrow_3lib_StructType;
  __pyx_vtable_7pyarrow_3lib_StructType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_StructType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_10StructType_init;
  __pyx_vtable_7pyarrow_3lib_StructType.field = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_StructType *, int))__pyx_f_7pyarrow_3lib_10StructType_field;
  __pyx_vtable_7pyarrow_3lib_StructType.field_by_name = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_StructType *, PyObject *))__pyx_f_7pyarrow_3lib_10StructType_field_by_name;
  __pyx_type_7pyarrow_3lib_StructType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 283, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructType.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(4, 283, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__.doc = __pyx_doc_7pyarrow_3lib_10StructType___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(4, 283, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__.doc = __pyx_doc_7pyarrow_3lib_10StructType_2__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(4, 283, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__.doc = __pyx_doc_7pyarrow_3lib_10StructType_5__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 283, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructType, (PyObject *)&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 283, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_StructType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_StructType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_StructType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_StructType = &__pyx_type_7pyarrow_3lib_StructType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryMemo) < 0) __PYX_ERR(4, 197, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryMemo.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryMemo.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryMemo.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryMemo.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryMemo, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryMemo) < 0) __PYX_ERR(4, 197, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DictionaryMemo) < 0) __PYX_ERR(4, 197, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DictionaryMemo = &__pyx_type_7pyarrow_3lib_DictionaryMemo;
  __pyx_vtabptr_7pyarrow_3lib_DictionaryType = &__pyx_vtable_7pyarrow_3lib_DictionaryType;
  __pyx_vtable_7pyarrow_3lib_DictionaryType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_DictionaryType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_14DictionaryType_init;
  __pyx_type_7pyarrow_3lib_DictionaryType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 206, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryType.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 206, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 206, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DictionaryType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DictionaryType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DictionaryType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DictionaryType = &__pyx_type_7pyarrow_3lib_DictionaryType;
  __pyx_vtabptr_7pyarrow_3lib_TimestampType = &__pyx_vtable_7pyarrow_3lib_TimestampType;
  __pyx_vtable_7pyarrow_3lib_TimestampType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_TimestampType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_13TimestampType_init;
  __pyx_type_7pyarrow_3lib_TimestampType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 394, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampType.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 394, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampType, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 394, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_TimestampType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_TimestampType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_TimestampType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_TimestampType = &__pyx_type_7pyarrow_3lib_TimestampType;
  __pyx_vtabptr_7pyarrow_3lib_Time32Type = &__pyx_vtable_7pyarrow_3lib_Time32Type;
  __pyx_vtable_7pyarrow_3lib_Time32Type.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_Time32Type.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_10Time32Type_init;
  __pyx_type_7pyarrow_3lib_Time32Type.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 435, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 435, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 435, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time32Type.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time32Type.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time32Type, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time32Type = &__pyx_type_7pyarrow_3lib_Time32Type;
  __pyx_vtabptr_7pyarrow_3lib_Time64Type = &__pyx_vtable_7pyarrow_3lib_Time64Type;
  __pyx_vtable_7pyarrow_3lib_Time64Type.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_Time64Type.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_10Time64Type_init;
  __pyx_type_7pyarrow_3lib_Time64Type.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 452, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 452, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 452, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time64Type.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time64Type.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time64Type, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time64Type = &__pyx_type_7pyarrow_3lib_Time64Type;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType = &__pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init;
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 469, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 469, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 469, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryType;
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Type = &__pyx_vtable_7pyarrow_3lib_Decimal128Type;
  __pyx_vtable_7pyarrow_3lib_Decimal128Type.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType;
  __pyx_vtable_7pyarrow_3lib_Decimal128Type.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_14Decimal128Type_init;
  __pyx_type_7pyarrow_3lib_Decimal128Type.tp_base = __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 490, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Decimal128Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Decimal128Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Decimal128Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Decimal128Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Decimal128Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 490, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 490, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Decimal128Type.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Decimal128Type.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Decimal128Type = &__pyx_type_7pyarrow_3lib_Decimal128Type;
  __pyx_vtabptr_7pyarrow_3lib_BaseExtensionType = &__pyx_vtable_7pyarrow_3lib_BaseExtensionType;
  __pyx_vtable_7pyarrow_3lib_BaseExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_BaseExtensionType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_17BaseExtensionType_init;
  __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BaseExtensionType) < 0) __PYX_ERR(4, 517, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BaseExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BaseExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BaseExtensionType) < 0) __PYX_ERR(4, 517, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_BaseExtensionType) < 0) __PYX_ERR(4, 517, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BaseExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_BaseExtensionType = &__pyx_type_7pyarrow_3lib_BaseExtensionType;
  __pyx_vtabptr_7pyarrow_3lib_ExtensionType = &__pyx_vtable_7pyarrow_3lib_ExtensionType;
  __pyx_vtable_7pyarrow_3lib_ExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType;
  __pyx_vtable_7pyarrow_3lib_ExtensionType.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_13ExtensionType_init;
  __pyx_type_7pyarrow_3lib_ExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_BaseExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ExtensionType) < 0) __PYX_ERR(4, 541, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_ExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ExtensionType, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(4, 541, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__.doc = __pyx_doc_7pyarrow_3lib_13ExtensionType_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ExtensionType) < 0) __PYX_ERR(4, 541, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_ExtensionType) < 0) __PYX_ERR(4, 541, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ExtensionType, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ExtensionType = &__pyx_type_7pyarrow_3lib_ExtensionType;
  __pyx_vtabptr_7pyarrow_3lib_PyExtensionType = &__pyx_vtable_7pyarrow_3lib_PyExtensionType;
  __pyx_vtable_7pyarrow_3lib_PyExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ExtensionType;
  __pyx_type_7pyarrow_3lib_PyExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_ExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_PyExtensionType) < 0) __PYX_ERR(4, 616, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_PyExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_PyExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_PyExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_PyExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_PyExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_PyExtensionType) < 0) __PYX_ERR(4, 616, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PyExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_PyExtensionType) < 0) __PYX_ERR(4, 616, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_PyExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_PyExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_PyExtensionType, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_PyExtensionType = &__pyx_type_7pyarrow_3lib_PyExtensionType;
  __pyx_vtabptr_7pyarrow_3lib_Field = &__pyx_vtable_7pyarrow_3lib_Field;
  __pyx_vtable_7pyarrow_3lib_Field.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Field *, std::shared_ptr< arrow::Field>  const &))__pyx_f_7pyarrow_3lib_5Field_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 719, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Field.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Field.tp_dictoffset && __pyx_type_7pyarrow_3lib_Field.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Field.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Field.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 719, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Field, (PyObject *)&__pyx_type_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 719, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Field = &__pyx_type_7pyarrow_3lib_Field;
  __pyx_vtabptr_7pyarrow_3lib_Schema = &__pyx_vtable_7pyarrow_3lib_Schema;
  __pyx_vtable_7pyarrow_3lib_Schema.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::vector<std::shared_ptr< arrow::Field> >  const &))__pyx_f_7pyarrow_3lib_6Schema_init;
  __pyx_vtable_7pyarrow_3lib_Schema.init_schema = (void (*)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::shared_ptr< arrow::Schema>  const &))__pyx_f_7pyarrow_3lib_6Schema_init_schema;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 842, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Schema.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Schema.tp_dictoffset && __pyx_type_7pyarrow_3lib_Schema.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Schema.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Schema.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 842, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Schema, (PyObject *)&__pyx_type_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 842, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Schema = &__pyx_type_7pyarrow_3lib_Schema;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Scalar = &__pyx_type_7pyarrow_3lib_Scalar;
  __pyx_type_7pyarrow_3lib_NAType.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NAType) < 0) __PYX_ERR(18, 157, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NAType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NAType.tp_dictoffset && __pyx_type_7pyarrow_3lib_NAType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NAType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NAType, (PyObject *)&__pyx_type_7pyarrow_3lib_NAType) < 0) __PYX_ERR(18, 157, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NAType = &__pyx_type_7pyarrow_3lib_NAType;
  __pyx_vtabptr_7pyarrow_3lib_ArrayValue = &__pyx_vtable_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_ArrayValue.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t))__pyx_f_7pyarrow_3lib_10ArrayValue_init;
  __pyx_vtable_7pyarrow_3lib_ArrayValue._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_10ArrayValue__set_array;
  __pyx_type_7pyarrow_3lib_ArrayValue.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ArrayValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ArrayValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ArrayValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ArrayValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ArrayValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ArrayValue = &__pyx_type_7pyarrow_3lib_ArrayValue;
  __pyx_vtabptr_7pyarrow_3lib_ScalarValue = &__pyx_vtable_7pyarrow_3lib_ScalarValue;
  __pyx_vtable_7pyarrow_3lib_ScalarValue.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ScalarValue *, std::shared_ptr< arrow::Scalar>  const &))__pyx_f_7pyarrow_3lib_11ScalarValue_init;
  __pyx_type_7pyarrow_3lib_ScalarValue.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 829, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ScalarValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ScalarValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ScalarValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ScalarValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ScalarValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 829, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ScalarValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 829, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 829, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ScalarValue = &__pyx_type_7pyarrow_3lib_ScalarValue;
  __pyx_vtabptr_7pyarrow_3lib_Int8Value = &__pyx_vtable_7pyarrow_3lib_Int8Value;
  __pyx_vtable_7pyarrow_3lib_Int8Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int8Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int8Value = &__pyx_type_7pyarrow_3lib_Int8Value;
  __pyx_vtabptr_7pyarrow_3lib_Int64Value = &__pyx_vtable_7pyarrow_3lib_Int64Value;
  __pyx_vtable_7pyarrow_3lib_Int64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int64Value = &__pyx_type_7pyarrow_3lib_Int64Value;
  __pyx_vtabptr_7pyarrow_3lib_ListValue = &__pyx_vtable_7pyarrow_3lib_ListValue;
  __pyx_vtable_7pyarrow_3lib_ListValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_ListValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_9ListValue__set_array;
  __pyx_vtable_7pyarrow_3lib_ListValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_ListValue *, int64_t))__pyx_f_7pyarrow_3lib_9ListValue_getitem;
  __pyx_vtable_7pyarrow_3lib_ListValue.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_ListValue *))__pyx_f_7pyarrow_3lib_9ListValue_length;
  __pyx_type_7pyarrow_3lib_ListValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(5, 572, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__.doc = __pyx_doc_7pyarrow_3lib_9ListValue___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 572, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__.doc = __pyx_doc_7pyarrow_3lib_9ListValue_2__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(5, 572, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__.doc = __pyx_doc_7pyarrow_3lib_9ListValue_4__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ListValue = &__pyx_type_7pyarrow_3lib_ListValue;
  __pyx_vtabptr_7pyarrow_3lib_LargeListValue = &__pyx_vtable_7pyarrow_3lib_LargeListValue;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_14LargeListValue__set_array;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *, int64_t))__pyx_f_7pyarrow_3lib_14LargeListValue_getitem;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *))__pyx_f_7pyarrow_3lib_14LargeListValue_length;
  __pyx_type_7pyarrow_3lib_LargeListValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 623, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeListValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeListValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeListValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeListValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(5, 623, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__.doc = __pyx_doc_7pyarrow_3lib_14LargeListValue___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 623, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__.doc = __pyx_doc_7pyarrow_3lib_14LargeListValue_2__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(5, 623, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__.doc = __pyx_doc_7pyarrow_3lib_14LargeListValue_4__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeListValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 623, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeListValue, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 623, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 623, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LargeListValue = &__pyx_type_7pyarrow_3lib_LargeListValue;
  __pyx_vtabptr_7pyarrow_3lib_StructValue = &__pyx_vtable_7pyarrow_3lib_StructValue;
  __pyx_vtable_7pyarrow_3lib_StructValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_StructValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_11StructValue__set_array;
  __pyx_type_7pyarrow_3lib_StructValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 722, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 722, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__.doc = __pyx_doc_7pyarrow_3lib_11StructValue___getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 722, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 722, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 722, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StructValue = &__pyx_type_7pyarrow_3lib_StructValue;
  __pyx_vtabptr_7pyarrow_3lib_UnionValue = &__pyx_vtable_7pyarrow_3lib_UnionValue;
  __pyx_vtable_7pyarrow_3lib_UnionValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_UnionValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_10UnionValue__set_array;
  __pyx_vtable_7pyarrow_3lib_UnionValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_UnionValue *, int64_t))__pyx_f_7pyarrow_3lib_10UnionValue_getitem;
  __pyx_type_7pyarrow_3lib_UnionValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 674, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 674, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionValue, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 674, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 674, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UnionValue = &__pyx_type_7pyarrow_3lib_UnionValue;
  __pyx_vtabptr_7pyarrow_3lib_StringValue = &__pyx_vtable_7pyarrow_3lib_StringValue;
  __pyx_vtable_7pyarrow_3lib_StringValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_StringValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 462, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StringValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 462, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 462, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 462, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StringValue = &__pyx_type_7pyarrow_3lib_StringValue;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue = &__pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 412, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__PandasConvertible.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__PandasConvertible.tp_dictoffset && __pyx_type_7pyarrow_3lib__PandasConvertible.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__PandasConvertible.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PandasConvertible, (PyObject *)&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 412, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 412, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__PandasConvertible = &__pyx_type_7pyarrow_3lib__PandasConvertible;
  __pyx_vtabptr_7pyarrow_3lib_Array = &__pyx_vtable_7pyarrow_3lib_Array;
  __pyx_vtable_7pyarrow_3lib_Array.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Array *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_5Array_init;
  __pyx_vtable_7pyarrow_3lib_Array.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_Array *, int64_t))__pyx_f_7pyarrow_3lib_5Array_getitem;
  __pyx_vtable_7pyarrow_3lib_Array.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_Array *))__pyx_f_7pyarrow_3lib_5Array_length;
  __pyx_type_7pyarrow_3lib_Array.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 484, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_Array, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(1, 484, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_5Array_39__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_5Array_39__getitem__.doc = __pyx_doc_7pyarrow_3lib_5Array_39__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_5Array_39__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 484, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 484, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Array, __weakref__);
  __pyx_ptype_7pyarrow_3lib_Array = &__pyx_type_7pyarrow_3lib_Array;
  __pyx_vtabptr_7pyarrow_3lib_Tensor = &__pyx_vtable_7pyarrow_3lib_Tensor;
  __pyx_vtable_7pyarrow_3lib_Tensor.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Tensor *, std::shared_ptr< arrow::Tensor>  const &))__pyx_f_7pyarrow_3lib_6Tensor_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Tensor.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Tensor.tp_dictoffset && __pyx_type_7pyarrow_3lib_Tensor.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Tensor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Tensor.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Tensor, (PyObject *)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Tensor = &__pyx_type_7pyarrow_3lib_Tensor;
  __pyx_vtabptr_7pyarrow_3lib_SparseTensorCSR = &__pyx_vtable_7pyarrow_3lib_SparseTensorCSR;
  __pyx_vtable_7pyarrow_3lib_SparseTensorCSR.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_SparseTensorCSR *, std::shared_ptr< arrow::SparseTensorCSR>  const &))__pyx_f_7pyarrow_3lib_15SparseTensorCSR_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SparseTensorCSR) < 0) __PYX_ERR(13, 246, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SparseTensorCSR.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SparseTensorCSR.tp_dictoffset && __pyx_type_7pyarrow_3lib_SparseTensorCSR.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SparseTensorCSR.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_SparseTensorCSR.tp_dict, __pyx_vtabptr_7pyarrow_3lib_SparseTensorCSR) < 0) __PYX_ERR(13, 246, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseTensorCSR, (PyObject *)&__pyx_type_7pyarrow_3lib_SparseTensorCSR) < 0) __PYX_ERR(13, 246, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SparseTensorCSR) < 0) __PYX_ERR(13, 246, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SparseTensorCSR = &__pyx_type_7pyarrow_3lib_SparseTensorCSR;
  __pyx_vtabptr_7pyarrow_3lib_SparseTensorCOO = &__pyx_vtable_7pyarrow_3lib_SparseTensorCOO;
  __pyx_vtable_7pyarrow_3lib_SparseTensorCOO.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_SparseTensorCOO *, std::shared_ptr< arrow::SparseTensorCOO>  const &))__pyx_f_7pyarrow_3lib_15SparseTensorCOO_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SparseTensorCOO) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SparseTensorCOO.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SparseTensorCOO.tp_dictoffset && __pyx_type_7pyarrow_3lib_SparseTensorCOO.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SparseTensorCOO.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_SparseTensorCOO.tp_dict, __pyx_vtabptr_7pyarrow_3lib_SparseTensorCOO) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseTensorCOO, (PyObject *)&__pyx_type_7pyarrow_3lib_SparseTensorCOO) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SparseTensorCOO) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SparseTensorCOO = &__pyx_type_7pyarrow_3lib_SparseTensorCOO;
  __pyx_vtabptr_7pyarrow_3lib_NullArray = &__pyx_vtable_7pyarrow_3lib_NullArray;
  __pyx_vtable_7pyarrow_3lib_NullArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_NullArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 1012, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NullArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NullArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_NullArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NullArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NullArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 1012, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 1012, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_NullArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_NullArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_NullArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_NullArray = &__pyx_type_7pyarrow_3lib_NullArray;
  __pyx_vtabptr_7pyarrow_3lib_BooleanArray = &__pyx_vtable_7pyarrow_3lib_BooleanArray;
  __pyx_vtable_7pyarrow_3lib_BooleanArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_BooleanArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 1018, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BooleanArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BooleanArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_BooleanArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BooleanArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BooleanArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 1018, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 1018, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BooleanArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BooleanArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BooleanArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_BooleanArray = &__pyx_type_7pyarrow_3lib_BooleanArray;
  __pyx_vtabptr_7pyarrow_3lib_NumericArray = &__pyx_vtable_7pyarrow_3lib_NumericArray;
  __pyx_vtable_7pyarrow_3lib_NumericArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_NumericArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 1024, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NumericArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NumericArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_NumericArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NumericArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NumericArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 1024, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumericArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 1024, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_NumericArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_NumericArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_NumericArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_NumericArray = &__pyx_type_7pyarrow_3lib_NumericArray;
  __pyx_vtabptr_7pyarrow_3lib_IntegerArray = &__pyx_vtable_7pyarrow_3lib_IntegerArray;
  __pyx_vtable_7pyarrow_3lib_IntegerArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_IntegerArray.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 1030, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_IntegerArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_IntegerArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_IntegerArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_IntegerArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_IntegerArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 1030, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntegerArray, (PyObject *)&__pyx_type_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 1030, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_IntegerArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_IntegerArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_IntegerArray, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_IntegerArray = &__pyx_type_7pyarrow_3lib_IntegerArray;
  __pyx_vtabptr_7pyarrow_3lib_FloatingPointArray = &__pyx_vtable_7pyarrow_3lib_FloatingPointArray;
  __pyx_vtable_7pyarrow_3lib_FloatingPointArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 1036, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 1036, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatingPointArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 1036, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FloatingPointArray = &__pyx_type_7pyarrow_3lib_FloatingPointArray;
  __pyx_vtabptr_7pyarrow_3lib_Int8Array = &__pyx_vtable_7pyarrow_3lib_Int8Array;
  __pyx_vtable_7pyarrow_3lib_Int8Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int8Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 1042, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 1042, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 1042, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int8Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int8Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int8Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int8Array = &__pyx_type_7pyarrow_3lib_Int8Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Array = &__pyx_vtable_7pyarrow_3lib_UInt8Array;
  __pyx_vtable_7pyarrow_3lib_UInt8Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt8Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 1048, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 1048, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 1048, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt8Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt8Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt8Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt8Array = &__pyx_type_7pyarrow_3lib_UInt8Array;
  __pyx_vtabptr_7pyarrow_3lib_Int16Array = &__pyx_vtable_7pyarrow_3lib_Int16Array;
  __pyx_vtable_7pyarrow_3lib_Int16Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int16Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 1054, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 1054, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 1054, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int16Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int16Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int16Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int16Array = &__pyx_type_7pyarrow_3lib_Int16Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Array = &__pyx_vtable_7pyarrow_3lib_UInt16Array;
  __pyx_vtable_7pyarrow_3lib_UInt16Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt16Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 1060, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 1060, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 1060, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt16Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt16Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt16Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt16Array = &__pyx_type_7pyarrow_3lib_UInt16Array;
  __pyx_vtabptr_7pyarrow_3lib_Int32Array = &__pyx_vtable_7pyarrow_3lib_Int32Array;
  __pyx_vtable_7pyarrow_3lib_Int32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int32Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 1066, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 1066, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 1066, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int32Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int32Array = &__pyx_type_7pyarrow_3lib_Int32Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Array = &__pyx_vtable_7pyarrow_3lib_UInt32Array;
  __pyx_vtable_7pyarrow_3lib_UInt32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt32Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 1072, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 1072, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 1072, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt32Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt32Array = &__pyx_type_7pyarrow_3lib_UInt32Array;
  __pyx_vtabptr_7pyarrow_3lib_Int64Array = &__pyx_vtable_7pyarrow_3lib_Int64Array;
  __pyx_vtable_7pyarrow_3lib_Int64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int64Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 1078, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 1078, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 1078, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int64Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int64Array = &__pyx_type_7pyarrow_3lib_Int64Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Array = &__pyx_vtable_7pyarrow_3lib_UInt64Array;
  __pyx_vtable_7pyarrow_3lib_UInt64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt64Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 1084, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 1084, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 1084, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt64Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt64Array = &__pyx_type_7pyarrow_3lib_UInt64Array;
  __pyx_vtabptr_7pyarrow_3lib_HalfFloatArray = &__pyx_vtable_7pyarrow_3lib_HalfFloatArray;
  __pyx_vtable_7pyarrow_3lib_HalfFloatArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_base = __pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 1120, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 1120, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 1120, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_HalfFloatArray = &__pyx_type_7pyarrow_3lib_HalfFloatArray;
  __pyx_vtabptr_7pyarrow_3lib_FloatArray = &__pyx_vtable_7pyarrow_3lib_FloatArray;
  __pyx_vtable_7pyarrow_3lib_FloatArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  __pyx_type_7pyarrow_3lib_FloatArray.tp_base = __pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 1126, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 1126, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 1126, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FloatArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FloatArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FloatArray, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FloatArray = &__pyx_type_7pyarrow_3lib_FloatArray;
  __pyx_vtabptr_7pyarrow_3lib_DoubleArray = &__pyx_vtable_7pyarrow_3lib_DoubleArray;
  __pyx_vtable_7pyarrow_3lib_DoubleArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  __pyx_type_7pyarrow_3lib_DoubleArray.tp_base = __pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 1132, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 1132, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 1132, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DoubleArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DoubleArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DoubleArray, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DoubleArray = &__pyx_type_7pyarrow_3lib_DoubleArray;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray = &__pyx_vtable_7pyarrow_3lib_FixedSizeBinaryArray;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 1138, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 1138, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 1138, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray;
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Array = &__pyx_vtable_7pyarrow_3lib_Decimal128Array;
  __pyx_vtable_7pyarrow_3lib_Decimal128Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray;
  __pyx_type_7pyarrow_3lib_Decimal128Array.tp_base = __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1144, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Decimal128Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Decimal128Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Decimal128Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Decimal128Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Decimal128Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1144, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1144, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Decimal128Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Decimal128Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Decimal128Array = &__pyx_type_7pyarrow_3lib_Decimal128Array;
  __pyx_vtabptr_7pyarrow_3lib_StructArray = &__pyx_vtable_7pyarrow_3lib_StructArray;
  __pyx_vtable_7pyarrow_3lib_StructArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_StructArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1513, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1513, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1513, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_StructArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_StructArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_StructArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_StructArray = &__pyx_type_7pyarrow_3lib_StructArray;
  __pyx_vtabptr_7pyarrow_3lib_ListArray = &__pyx_vtable_7pyarrow_3lib_ListArray;
  __pyx_vtable_7pyarrow_3lib_ListArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_ListArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1150, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1150, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1150, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ListArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ListArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ListArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ListArray = &__pyx_type_7pyarrow_3lib_ListArray;
  __pyx_vtabptr_7pyarrow_3lib_LargeListArray = &__pyx_vtable_7pyarrow_3lib_LargeListArray;
  __pyx_vtable_7pyarrow_3lib_LargeListArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_LargeListArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeListArray) < 0) __PYX_ERR(1, 1202, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeListArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeListArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeListArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeListArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeListArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeListArray) < 0) __PYX_ERR(1, 1202, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeListArray, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeListArray) < 0) __PYX_ERR(1, 1202, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeListArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeListArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeListArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeListArray = &__pyx_type_7pyarrow_3lib_LargeListArray;
  __pyx_vtabptr_7pyarrow_3lib_UnionArray = &__pyx_vtable_7pyarrow_3lib_UnionArray;
  __pyx_vtable_7pyarrow_3lib_UnionArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_UnionArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1250, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1250, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionArray, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1250, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UnionArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UnionArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UnionArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UnionArray = &__pyx_type_7pyarrow_3lib_UnionArray;
  __pyx_vtabptr_7pyarrow_3lib_StringArray = &__pyx_vtable_7pyarrow_3lib_StringArray;
  __pyx_vtable_7pyarrow_3lib_StringArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_StringArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1336, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StringArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1336, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1336, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_StringArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_StringArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_StringArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_StringArray = &__pyx_type_7pyarrow_3lib_StringArray;
  __pyx_vtabptr_7pyarrow_3lib_BinaryArray = &__pyx_vtable_7pyarrow_3lib_BinaryArray;
  __pyx_vtable_7pyarrow_3lib_BinaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_BinaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1400, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_BinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1400, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1400, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BinaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BinaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BinaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_BinaryArray = &__pyx_type_7pyarrow_3lib_BinaryArray;
  __pyx_vtabptr_7pyarrow_3lib_DictionaryArray = &__pyx_vtable_7pyarrow_3lib_DictionaryArray;
  __pyx_vtable_7pyarrow_3lib_DictionaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_DictionaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1412, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1412, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1412, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DictionaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DictionaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DictionaryArray = &__pyx_type_7pyarrow_3lib_DictionaryArray;
  __pyx_vtabptr_7pyarrow_3lib_ExtensionArray = &__pyx_vtable_7pyarrow_3lib_ExtensionArray;
  __pyx_vtable_7pyarrow_3lib_ExtensionArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_ExtensionArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ExtensionArray) < 0) __PYX_ERR(1, 1640, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ExtensionArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ExtensionArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ExtensionArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ExtensionArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ExtensionArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ExtensionArray) < 0) __PYX_ERR(1, 1640, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ExtensionArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ExtensionArray) < 0) __PYX_ERR(1, 1640, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ExtensionArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ExtensionArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ExtensionArray = &__pyx_type_7pyarrow_3lib_ExtensionArray;
  __pyx_vtabptr_7pyarrow_3lib_ChunkedArray = &__pyx_vtable_7pyarrow_3lib_ChunkedArray;
  __pyx_vtable_7pyarrow_3lib_ChunkedArray.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, std::shared_ptr< arrow::ChunkedArray>  const &))__pyx_f_7pyarrow_3lib_12ChunkedArray_init;
  __pyx_vtable_7pyarrow_3lib_ChunkedArray.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, int64_t))__pyx_f_7pyarrow_3lib_12ChunkedArray_getitem;
  __pyx_type_7pyarrow_3lib_ChunkedArray.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(12, 20, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ChunkedArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ChunkedArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ChunkedArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ChunkedArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ChunkedArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(12, 20, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChunkedArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(12, 20, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ChunkedArray = &__pyx_type_7pyarrow_3lib_ChunkedArray;
  __pyx_vtabptr_7pyarrow_3lib_Table = &__pyx_vtable_7pyarrow_3lib_Table;
  __pyx_vtable_7pyarrow_3lib_Table.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Table *, std::shared_ptr< arrow::Table>  const &))__pyx_f_7pyarrow_3lib_5Table_init;
  __pyx_type_7pyarrow_3lib_Table.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(12, 788, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Table.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Table.tp_dictoffset && __pyx_type_7pyarrow_3lib_Table.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Table.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Table.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Table) < 0) __PYX_ERR(12, 788, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Table, (PyObject *)&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(12, 788, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Table = &__pyx_type_7pyarrow_3lib_Table;
  __pyx_vtabptr_7pyarrow_3lib_RecordBatch = &__pyx_vtable_7pyarrow_3lib_RecordBatch;
  __pyx_vtable_7pyarrow_3lib_RecordBatch.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_RecordBatch *, std::shared_ptr< arrow::RecordBatch>  const &))__pyx_f_7pyarrow_3lib_11RecordBatch_init;
  __pyx_type_7pyarrow_3lib_RecordBatch.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(12, 457, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_RecordBatch.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_RecordBatch.tp_dictoffset && __pyx_type_7pyarrow_3lib_RecordBatch.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_RecordBatch.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_RecordBatch.tp_dict, __pyx_vtabptr_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(12, 457, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatch, (PyObject *)&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(12, 457, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_RecordBatch = &__pyx_type_7pyarrow_3lib_RecordBatch;
  __pyx_vtabptr_7pyarrow_3lib_Buffer = &__pyx_vtable_7pyarrow_3lib_Buffer;
  __pyx_vtable_7pyarrow_3lib_Buffer.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Buffer *, std::shared_ptr< arrow::Buffer>  const &))__pyx_f_7pyarrow_3lib_6Buffer_init;
  __pyx_vtable_7pyarrow_3lib_Buffer.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_Buffer *, int64_t))__pyx_f_7pyarrow_3lib_6Buffer_getitem;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(6, 880, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Buffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Buffer.tp_dictoffset && __pyx_type_7pyarrow_3lib_Buffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Buffer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Buffer.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(6, 880, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Buffer, (PyObject *)&__pyx_type_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(6, 880, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Buffer = &__pyx_type_7pyarrow_3lib_Buffer;
  __pyx_vtabptr_7pyarrow_3lib_ResizableBuffer = &__pyx_vtable_7pyarrow_3lib_ResizableBuffer;
  __pyx_vtable_7pyarrow_3lib_ResizableBuffer.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Buffer;
  __pyx_vtable_7pyarrow_3lib_ResizableBuffer.init_rz = (void (*)(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *, std::shared_ptr< arrow::ResizableBuffer>  const &))__pyx_f_7pyarrow_3lib_15ResizableBuffer_init_rz;
  __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_base = __pyx_ptype_7pyarrow_3lib_Buffer;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(6, 1061, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ResizableBuffer.tp_dictoffset && __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ResizableBuffer.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(6, 1061, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ResizableBuffer, (PyObject *)&__pyx_type_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(6, 1061, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ResizableBuffer = &__pyx_type_7pyarrow_3lib_ResizableBuffer;
  __pyx_vtabptr_7pyarrow_3lib_NativeFile = &__pyx_vtable_7pyarrow_3lib_NativeFile;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_random_access_file = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::RandomAccessFile> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_input_stream = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::InputStream> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_output_stream = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::OutputStream> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_random_access_file = (std::shared_ptr<arrow::io::RandomAccessFile>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_input_stream = (std::shared_ptr<arrow::io::InputStream>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_output_stream = (std::shared_ptr<arrow::io::OutputStream>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NativeFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NativeFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_NativeFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NativeFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NativeFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NativeFile, (PyObject *)&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_NativeFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_NativeFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_NativeFile, __weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NativeFile = &__pyx_type_7pyarrow_3lib_NativeFile;
  __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream = &__pyx_vtable_7pyarrow_3lib_BufferedInputStream;
  __pyx_vtable_7pyarrow_3lib_BufferedInputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1246, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1246, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferedInputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1246, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1246, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferedInputStream = &__pyx_type_7pyarrow_3lib_BufferedInputStream;
  __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream = &__pyx_vtable_7pyarrow_3lib_BufferedOutputStream;
  __pyx_vtable_7pyarrow_3lib_BufferedOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1296, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1296, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferedOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1296, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1296, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferedOutputStream = &__pyx_type_7pyarrow_3lib_BufferedOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream = &__pyx_vtable_7pyarrow_3lib_CompressedInputStream;
  __pyx_vtable_7pyarrow_3lib_CompressedInputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1182, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1182, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompressedInputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1182, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1182, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_CompressedInputStream = &__pyx_type_7pyarrow_3lib_CompressedInputStream;
  __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream = &__pyx_vtable_7pyarrow_3lib_CompressedOutputStream;
  __pyx_vtable_7pyarrow_3lib_CompressedOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1211, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1211, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompressedOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1211, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1211, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_CompressedOutputStream = &__pyx_type_7pyarrow_3lib_CompressedOutputStream;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(7, 171, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CRecordBatchWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(7, 171, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(7, 171, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__CRecordBatchWriter = &__pyx_type_7pyarrow_3lib__CRecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(7, 289, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CRecordBatchReader, (PyObject *)&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(7, 289, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(7, 289, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__CRecordBatchReader = &__pyx_type_7pyarrow_3lib__CRecordBatchReader;
  __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim = &__pyx_vtable_7pyarrow_3lib__PandasAPIShim;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._import_pandas = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, int))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._check_import = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._have_pandas_internal = (int (*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.infer_dtype = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_array_like = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_categorical = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_datetimetz = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_sparse = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_data_frame = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_series = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__PandasAPIShim.tp_dictoffset && __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib__PandasAPIShim.tp_dict, __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PandasAPIShim, (PyObject *)&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__PandasAPIShim = &__pyx_type_7pyarrow_3lib__PandasAPIShim;
  __pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool = &__pyx_vtable_7pyarrow_3lib_LoggingMemoryPool;
  __pyx_vtable_7pyarrow_3lib_LoggingMemoryPool.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_base = __pyx_ptype_7pyarrow_3lib_MemoryPool;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LoggingMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LoggingMemoryPool = &__pyx_type_7pyarrow_3lib_LoggingMemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool = &__pyx_vtable_7pyarrow_3lib_ProxyMemoryPool;
  __pyx_vtable_7pyarrow_3lib_ProxyMemoryPool.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_base = __pyx_ptype_7pyarrow_3lib_MemoryPool;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ProxyMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = &__pyx_type_7pyarrow_3lib_ProxyMemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_UnionType = &__pyx_vtable_7pyarrow_3lib_UnionType;
  __pyx_vtable_7pyarrow_3lib_UnionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_UnionType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_9UnionType_init;
  __pyx_type_7pyarrow_3lib_UnionType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 342, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(4, 342, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__.doc = __pyx_doc_7pyarrow_3lib_9UnionType___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(4, 342, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__.doc = __pyx_doc_7pyarrow_3lib_9UnionType_2__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(4, 342, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__.doc = __pyx_doc_7pyarrow_3lib_9UnionType_5__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 342, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionType, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 342, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UnionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UnionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UnionType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UnionType = &__pyx_type_7pyarrow_3lib_UnionType;
  __pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType = &__pyx_vtable_7pyarrow_3lib_UnknownExtensionType;
  __pyx_vtable_7pyarrow_3lib_UnknownExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_PyExtensionType;
  __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_PyExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnknownExtensionType) < 0) __PYX_ERR(4, 655, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType) < 0) __PYX_ERR(4, 655, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnknownExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_UnknownExtensionType) < 0) __PYX_ERR(4, 655, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType, __pyx_base.__pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UnknownExtensionType = &__pyx_type_7pyarrow_3lib_UnknownExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny) < 0) __PYX_ERR(4, 2076, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_dictoffset && __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ExtensionRegistryNanny, (PyObject *)&__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny) < 0) __PYX_ERR(4, 2076, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny) < 0) __PYX_ERR(4, 2076, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__ExtensionRegistryNanny = &__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny;
  __pyx_type_7pyarrow_3lib_NullType.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NullType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NullType.tp_dictoffset && __pyx_type_7pyarrow_3lib_NullType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NullType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullType, (PyObject *)&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NullType = &__pyx_type_7pyarrow_3lib_NullType;
  __pyx_vtabptr_7pyarrow_3lib_BooleanValue = &__pyx_vtable_7pyarrow_3lib_BooleanValue;
  __pyx_vtable_7pyarrow_3lib_BooleanValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_BooleanValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BooleanValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BooleanValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_BooleanValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BooleanValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BooleanValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BooleanValue = &__pyx_type_7pyarrow_3lib_BooleanValue;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Value = &__pyx_vtable_7pyarrow_3lib_UInt8Value;
  __pyx_vtable_7pyarrow_3lib_UInt8Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt8Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt8Value = &__pyx_type_7pyarrow_3lib_UInt8Value;
  __pyx_vtabptr_7pyarrow_3lib_Int16Value = &__pyx_vtable_7pyarrow_3lib_Int16Value;
  __pyx_vtable_7pyarrow_3lib_Int16Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int16Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int16Value = &__pyx_type_7pyarrow_3lib_Int16Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Value = &__pyx_vtable_7pyarrow_3lib_UInt16Value;
  __pyx_vtable_7pyarrow_3lib_UInt16Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt16Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt16Value = &__pyx_type_7pyarrow_3lib_UInt16Value;
  __pyx_vtabptr_7pyarrow_3lib_Int32Value = &__pyx_vtable_7pyarrow_3lib_Int32Value;
  __pyx_vtable_7pyarrow_3lib_Int32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int32Value = &__pyx_type_7pyarrow_3lib_Int32Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Value = &__pyx_vtable_7pyarrow_3lib_UInt32Value;
  __pyx_vtable_7pyarrow_3lib_UInt32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt32Value = &__pyx_type_7pyarrow_3lib_UInt32Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Value = &__pyx_vtable_7pyarrow_3lib_UInt64Value;
  __pyx_vtable_7pyarrow_3lib_UInt64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt64Value = &__pyx_type_7pyarrow_3lib_UInt64Value;
  __pyx_vtabptr_7pyarrow_3lib_Date32Value = &__pyx_vtable_7pyarrow_3lib_Date32Value;
  __pyx_vtable_7pyarrow_3lib_Date32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Date32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Date32Value = &__pyx_type_7pyarrow_3lib_Date32Value;
  __pyx_vtabptr_7pyarrow_3lib_Date64Value = &__pyx_vtable_7pyarrow_3lib_Date64Value;
  __pyx_vtable_7pyarrow_3lib_Date64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Date64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Date64Value = &__pyx_type_7pyarrow_3lib_Date64Value;
  __pyx_vtabptr_7pyarrow_3lib_Time32Value = &__pyx_vtable_7pyarrow_3lib_Time32Value;
  __pyx_vtable_7pyarrow_3lib_Time32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Time32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time32Value = &__pyx_type_7pyarrow_3lib_Time32Value;
  __pyx_vtabptr_7pyarrow_3lib_Time64Value = &__pyx_vtable_7pyarrow_3lib_Time64Value;
  __pyx_vtable_7pyarrow_3lib_Time64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Time64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time64Value = &__pyx_type_7pyarrow_3lib_Time64Value;
  __pyx_vtabptr_7pyarrow_3lib_TimestampValue = &__pyx_vtable_7pyarrow_3lib_TimestampValue;
  __pyx_vtable_7pyarrow_3lib_TimestampValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_TimestampValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampValue, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_TimestampValue = &__pyx_type_7pyarrow_3lib_TimestampValue;
  __pyx_vtabptr_7pyarrow_3lib_HalfFloatValue = &__pyx_vtable_7pyarrow_3lib_HalfFloatValue;
  __pyx_vtable_7pyarrow_3lib_HalfFloatValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 408, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HalfFloatValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HalfFloatValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 408, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 408, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 408, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HalfFloatValue = &__pyx_type_7pyarrow_3lib_HalfFloatValue;
  __pyx_vtabptr_7pyarrow_3lib_FloatValue = &__pyx_vtable_7pyarrow_3lib_FloatValue;
  __pyx_vtable_7pyarrow_3lib_FloatValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_FloatValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 421, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 421, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 421, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 421, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FloatValue = &__pyx_type_7pyarrow_3lib_FloatValue;
  __pyx_vtabptr_7pyarrow_3lib_DoubleValue = &__pyx_vtable_7pyarrow_3lib_DoubleValue;
  __pyx_vtable_7pyarrow_3lib_DoubleValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DoubleValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 434, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 434, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 434, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 434, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DoubleValue = &__pyx_type_7pyarrow_3lib_DoubleValue;
  __pyx_vtabptr_7pyarrow_3lib_DecimalValue = &__pyx_vtable_7pyarrow_3lib_DecimalValue;
  __pyx_vtable_7pyarrow_3lib_DecimalValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DecimalValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 447, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DecimalValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DecimalValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DecimalValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DecimalValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DecimalValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 447, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DecimalValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 447, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 447, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DecimalValue = &__pyx_type_7pyarrow_3lib_DecimalValue;
  __pyx_vtabptr_7pyarrow_3lib_LargeStringValue = &__pyx_vtable_7pyarrow_3lib_LargeStringValue;
  __pyx_vtable_7pyarrow_3lib_LargeStringValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_LargeStringValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 487, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeStringValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeStringValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeStringValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeStringValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeStringValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 487, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeStringValue, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 487, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 487, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LargeStringValue = &__pyx_type_7pyarrow_3lib_LargeStringValue;
  __pyx_vtabptr_7pyarrow_3lib_BinaryValue = &__pyx_vtable_7pyarrow_3lib_BinaryValue;
  __pyx_vtable_7pyarrow_3lib_BinaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_BinaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 512, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_BinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 512, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 512, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 512, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BinaryValue = &__pyx_type_7pyarrow_3lib_BinaryValue;
  __pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue = &__pyx_vtable_7pyarrow_3lib_LargeBinaryValue;
  __pyx_vtable_7pyarrow_3lib_LargeBinaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 542, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 542, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeBinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 542, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 542, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LargeBinaryValue = &__pyx_type_7pyarrow_3lib_LargeBinaryValue;
  __pyx_vtabptr_7pyarrow_3lib_DictionaryValue = &__pyx_vtable_7pyarrow_3lib_DictionaryValue;
  __pyx_vtable_7pyarrow_3lib_DictionaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DictionaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 765, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 765, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 765, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 765, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DictionaryValue = &__pyx_type_7pyarrow_3lib_DictionaryValue;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Scalar = &__pyx_vtable_7pyarrow_3lib_UInt8Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt8Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 865, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 865, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 865, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 865, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt8Scalar = &__pyx_type_7pyarrow_3lib_UInt8Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int8Scalar = &__pyx_vtable_7pyarrow_3lib_Int8Scalar;
  __pyx_vtable_7pyarrow_3lib_Int8Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int8Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 878, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 878, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 878, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 878, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int8Scalar = &__pyx_type_7pyarrow_3lib_Int8Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Scalar = &__pyx_vtable_7pyarrow_3lib_UInt16Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt16Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 891, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 891, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 891, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 891, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt16Scalar = &__pyx_type_7pyarrow_3lib_UInt16Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int16Scalar = &__pyx_vtable_7pyarrow_3lib_Int16Scalar;
  __pyx_vtable_7pyarrow_3lib_Int16Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int16Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 904, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 904, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 904, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 904, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int16Scalar = &__pyx_type_7pyarrow_3lib_Int16Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Scalar = &__pyx_vtable_7pyarrow_3lib_UInt32Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt32Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 917, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 917, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 917, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 917, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt32Scalar = &__pyx_type_7pyarrow_3lib_UInt32Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int32Scalar = &__pyx_vtable_7pyarrow_3lib_Int32Scalar;
  __pyx_vtable_7pyarrow_3lib_Int32Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int32Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 930, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 930, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 930, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 930, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int32Scalar = &__pyx_type_7pyarrow_3lib_Int32Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Scalar = &__pyx_vtable_7pyarrow_3lib_UInt64Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt64Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 943, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 943, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 943, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 943, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt64Scalar = &__pyx_type_7pyarrow_3lib_UInt64Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int64Scalar = &__pyx_vtable_7pyarrow_3lib_Int64Scalar;
  __pyx_vtable_7pyarrow_3lib_Int64Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int64Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 956, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 956, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 956, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 956, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int64Scalar = &__pyx_type_7pyarrow_3lib_Int64Scalar;
  __pyx_vtabptr_7pyarrow_3lib_FloatScalar = &__pyx_vtable_7pyarrow_3lib_FloatScalar;
  __pyx_vtable_7pyarrow_3lib_FloatScalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_FloatScalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 969, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatScalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatScalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatScalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatScalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatScalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 969, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatScalar, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 969, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 969, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FloatScalar = &__pyx_type_7pyarrow_3lib_FloatScalar;
  __pyx_vtabptr_7pyarrow_3lib_DoubleScalar = &__pyx_vtable_7pyarrow_3lib_DoubleScalar;
  __pyx_vtable_7pyarrow_3lib_DoubleScalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_DoubleScalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 982, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleScalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleScalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleScalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleScalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleScalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 982, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleScalar, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 982, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 982, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DoubleScalar = &__pyx_type_7pyarrow_3lib_DoubleScalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 308, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__FunctionContext.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__FunctionContext.tp_dictoffset && __pyx_type_7pyarrow_3lib__FunctionContext.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__FunctionContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FunctionContext, (PyObject *)&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 308, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 308, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__FunctionContext = &__pyx_type_7pyarrow_3lib__FunctionContext;
  __pyx_vtabptr_7pyarrow_3lib_Date32Array = &__pyx_vtable_7pyarrow_3lib_Date32Array;
  __pyx_vtable_7pyarrow_3lib_Date32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Date32Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 1090, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 1090, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 1090, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Date32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Date32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Date32Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Date32Array = &__pyx_type_7pyarrow_3lib_Date32Array;
  __pyx_vtabptr_7pyarrow_3lib_Date64Array = &__pyx_vtable_7pyarrow_3lib_Date64Array;
  __pyx_vtable_7pyarrow_3lib_Date64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Date64Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 1096, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 1096, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 1096, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Date64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Date64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Date64Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Date64Array = &__pyx_type_7pyarrow_3lib_Date64Array;
  __pyx_vtabptr_7pyarrow_3lib_TimestampArray = &__pyx_vtable_7pyarrow_3lib_TimestampArray;
  __pyx_vtable_7pyarrow_3lib_TimestampArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_TimestampArray.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 1102, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 1102, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampArray, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 1102, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_TimestampArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_TimestampArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_TimestampArray, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_TimestampArray = &__pyx_type_7pyarrow_3lib_TimestampArray;
  __pyx_vtabptr_7pyarrow_3lib_Time32Array = &__pyx_vtable_7pyarrow_3lib_Time32Array;
  __pyx_vtable_7pyarrow_3lib_Time32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Time32Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 1108, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 1108, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 1108, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time32Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time32Array = &__pyx_type_7pyarrow_3lib_Time32Array;
  __pyx_vtabptr_7pyarrow_3lib_Time64Array = &__pyx_vtable_7pyarrow_3lib_Time64Array;
  __pyx_vtable_7pyarrow_3lib_Time64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Time64Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 1114, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 1114, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 1114, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time64Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time64Array = &__pyx_type_7pyarrow_3lib_Time64Array;
  __pyx_vtabptr_7pyarrow_3lib_LargeStringArray = &__pyx_vtable_7pyarrow_3lib_LargeStringArray;
  __pyx_vtable_7pyarrow_3lib_LargeStringArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_LargeStringArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeStringArray) < 0) __PYX_ERR(1, 1368, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeStringArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeStringArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeStringArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeStringArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeStringArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeStringArray) < 0) __PYX_ERR(1, 1368, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeStringArray, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeStringArray) < 0) __PYX_ERR(1, 1368, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeStringArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeStringArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeStringArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeStringArray = &__pyx_type_7pyarrow_3lib_LargeStringArray;
  __pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray = &__pyx_vtable_7pyarrow_3lib_LargeBinaryArray;
  __pyx_vtable_7pyarrow_3lib_LargeBinaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeBinaryArray) < 0) __PYX_ERR(1, 1406, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray) < 0) __PYX_ERR(1, 1406, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeBinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeBinaryArray) < 0) __PYX_ERR(1, 1406, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeBinaryArray = &__pyx_type_7pyarrow_3lib_LargeBinaryArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringBuilder.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringBuilder.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringBuilder.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringBuilder.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringBuilder, (PyObject *)&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StringBuilder = &__pyx_type_7pyarrow_3lib_StringBuilder;
  __pyx_vtabptr_7pyarrow_3lib_PythonFile = &__pyx_vtable_7pyarrow_3lib_PythonFile;
  __pyx_vtable_7pyarrow_3lib_PythonFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_PythonFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(6, 617, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_PythonFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_PythonFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_PythonFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_PythonFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_PythonFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(6, 617, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PythonFile, (PyObject *)&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(6, 617, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_PythonFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_PythonFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_PythonFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(6, 617, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_PythonFile = &__pyx_type_7pyarrow_3lib_PythonFile;
  __pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile = &__pyx_vtable_7pyarrow_3lib_MemoryMappedFile;
  __pyx_vtable_7pyarrow_3lib_MemoryMappedFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(6, 699, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(6, 699, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryMappedFile, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(6, 699, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(6, 699, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MemoryMappedFile = &__pyx_type_7pyarrow_3lib_MemoryMappedFile;
  __pyx_vtabptr_7pyarrow_3lib_OSFile = &__pyx_vtable_7pyarrow_3lib_OSFile;
  __pyx_vtable_7pyarrow_3lib_OSFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_vtable_7pyarrow_3lib_OSFile._open_readable = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string,  arrow::MemoryPool *))__pyx_f_7pyarrow_3lib_6OSFile__open_readable;
  __pyx_vtable_7pyarrow_3lib_OSFile._open_writable = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string))__pyx_f_7pyarrow_3lib_6OSFile__open_writable;
  __pyx_type_7pyarrow_3lib_OSFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(6, 810, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_OSFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_OSFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_OSFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_OSFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_OSFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(6, 810, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OSFile, (PyObject *)&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(6, 810, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_OSFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_OSFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_OSFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(6, 810, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_OSFile = &__pyx_type_7pyarrow_3lib_OSFile;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter = &__pyx_vtable_7pyarrow_3lib_FixedSizeBufferWriter;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBufferWriter.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(6, 851, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(6, 851, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBufferWriter, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(6, 851, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(6, 851, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter = &__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter;
  __pyx_vtabptr_7pyarrow_3lib_BufferOutputStream = &__pyx_vtable_7pyarrow_3lib_BufferOutputStream;
  __pyx_vtable_7pyarrow_3lib_BufferOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(6, 1129, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(6, 1129, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(6, 1129, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(6, 1129, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferOutputStream = &__pyx_type_7pyarrow_3lib_BufferOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_MockOutputStream = &__pyx_vtable_7pyarrow_3lib_MockOutputStream;
  __pyx_vtable_7pyarrow_3lib_MockOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_MockOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(6, 1153, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MockOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MockOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_MockOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MockOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MockOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(6, 1153, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MockOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(6, 1153, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_MockOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_MockOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_MockOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(6, 1153, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MockOutputStream = &__pyx_type_7pyarrow_3lib_MockOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_BufferReader = &__pyx_vtable_7pyarrow_3lib_BufferReader;
  __pyx_vtable_7pyarrow_3lib_BufferReader.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferReader.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(6, 1164, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferReader.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(6, 1164, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferReader, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(6, 1164, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferReader.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferReader.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferReader, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(6, 1164, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferReader = &__pyx_type_7pyarrow_3lib_BufferReader;
  __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem = &__pyx_vtable_7pyarrow_3lib_HadoopFileSystem;
  __pyx_vtable_7pyarrow_3lib_HadoopFileSystem._ensure_client = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *))__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client;
  __pyx_vtable_7pyarrow_3lib_HadoopFileSystem._path_info = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *, PyObject *, arrow::io::HdfsPathInfo *))__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_dictoffset && __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HadoopFileSystem, (PyObject *)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HadoopFileSystem = &__pyx_type_7pyarrow_3lib_HadoopFileSystem;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_dictoffset && __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HdfsFileNanny, (PyObject *)&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__HdfsFileNanny = &__pyx_type_7pyarrow_3lib__HdfsFileNanny;
  __pyx_vtabptr_7pyarrow_3lib_HdfsFile = &__pyx_vtable_7pyarrow_3lib_HdfsFile;
  __pyx_vtable_7pyarrow_3lib_HdfsFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_HdfsFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HdfsFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HdfsFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_HdfsFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HdfsFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HdfsFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HdfsFile, (PyObject *)&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_HdfsFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_HdfsFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_HdfsFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HdfsFile = &__pyx_type_7pyarrow_3lib_HdfsFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(7, 121, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MessageReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MessageReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_MessageReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MessageReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MessageReader, (PyObject *)&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(7, 121, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(7, 121, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MessageReader = &__pyx_type_7pyarrow_3lib_MessageReader;
  __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_base = __pyx_ptype_7pyarrow_3lib__CRecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(7, 251, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchStreamWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(7, 251, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(7, 251, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter = &__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter;
  __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_base = __pyx_ptype_7pyarrow_3lib__CRecordBatchReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(7, 333, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchStreamReader, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(7, 333, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(7, 333, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchStreamReader = &__pyx_type_7pyarrow_3lib__RecordBatchStreamReader;
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_base = __pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(7, 352, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchFileWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(7, 352, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(7, 352, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchFileWriter = &__pyx_type_7pyarrow_3lib__RecordBatchFileWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(7, 367, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchFileReader, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(7, 367, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(7, 367, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchFileReader = &__pyx_type_7pyarrow_3lib__RecordBatchFileReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(14, 26, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FeatherWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FeatherWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib_FeatherWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FeatherWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FeatherWriter, (PyObject *)&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(14, 26, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(14, 26, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FeatherWriter = &__pyx_type_7pyarrow_3lib_FeatherWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(14, 71, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FeatherReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FeatherReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_FeatherReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FeatherReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FeatherReader, (PyObject *)&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(14, 71, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(14, 71, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FeatherReader = &__pyx_type_7pyarrow_3lib_FeatherReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(15, 48, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SerializationContext.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SerializationContext.tp_dictoffset && __pyx_type_7pyarrow_3lib_SerializationContext.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SerializationContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SerializationContext, (PyObject *)&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(15, 48, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(15, 48, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SerializationContext = &__pyx_type_7pyarrow_3lib_SerializationContext;
  __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject = &__pyx_vtable_7pyarrow_3lib_SerializedPyObject;
  __pyx_vtable_7pyarrow_3lib_SerializedPyObject._write_to = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *, arrow::io::OutputStream *))__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(15, 235, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SerializedPyObject.tp_dictoffset && __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_SerializedPyObject.tp_dict, __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(15, 235, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SerializedPyObject, (PyObject *)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(15, 235, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(15, 235, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SerializedPyObject = &__pyx_type_7pyarrow_3lib_SerializedPyObject;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__) < 0) __PYX_ERR(4, 320, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__) < 0) __PYX_ERR(4, 377, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(4, 858, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions) < 0) __PYX_ERR(5, 347, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__) < 0) __PYX_ERR(5, 589, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__) < 0) __PYX_ERR(5, 640, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__) < 0) __PYX_ERR(1, 731, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__) < 0) __PYX_ERR(12, 101, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_iterchunks) < 0) __PYX_ERR(12, 325, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_iterchunks.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_iterchunks.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_iterchunks.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_iterchunks.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_iterchunks = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_iterchunks;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_itercolumns) < 0) __PYX_ERR(12, 1329, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_itercolumns.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_itercolumns.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_itercolumns.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_itercolumns.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_itercolumns = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_itercolumns;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_10_download) < 0) __PYX_ERR(6, 475, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_10_download.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_10_download.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_10_download.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_10_download.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10_download = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_10_download;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_11_upload) < 0) __PYX_ERR(6, 563, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_upload.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_11_upload.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_upload.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_upload.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11_upload = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_11_upload;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__) < 0) __PYX_ERR(7, 149, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_13___iter__) < 0) __PYX_ERR(7, 298, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_13___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_13___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple) < 0) __PYX_ERR(15, 25, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_is_named_tuple;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(15, 33, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_15_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_15_genexpr.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_15_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_15_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_15_genexpr = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_15_genexpr;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __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(19, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(19, 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(20, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(20, 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(21, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(21, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initlib(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initlib(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_lib(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_lib(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_lib(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  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;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'lib' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_lib(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(8, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("lib", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(8, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(8, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(8, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(8, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_pyarrow__lib) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(8, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pyarrow.lib")) {
      if (unlikely(PyDict_SetItemString(modules, "pyarrow.lib", __pyx_m) < 0)) __PYX_ERR(8, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif

  /* "pyarrow/lib.pyx":24
 * from __future__ import absolute_import
 * 
 * import datetime             # <<<<<<<<<<<<<<
 * import decimal as _pydecimal
 * import json
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(8, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":25
 * 
 * import datetime
 * import decimal as _pydecimal             # <<<<<<<<<<<<<<
 * import json
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_decimal, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydecimal, __pyx_t_1) < 0) __PYX_ERR(8, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":26
 * import datetime
 * import decimal as _pydecimal
 * import json             # <<<<<<<<<<<<<<
 * import numpy as np
 * import os
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_1) < 0) __PYX_ERR(8, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":27
 * import decimal as _pydecimal
 * import json
 * import numpy as np             # <<<<<<<<<<<<<<
 * import os
 * import six
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(8, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":28
 * import json
 * import numpy as np
 * import os             # <<<<<<<<<<<<<<
 * import six
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":29
 * import numpy as np
 * import os
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import frombytes, tobytes, ordered_dict
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_1) < 0) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":31
 * import six
 * 
 * from pyarrow.compat import frombytes, tobytes, ordered_dict             # <<<<<<<<<<<<<<
 * 
 * from cython.operator cimport dereference as deref
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tobytes);
  __Pyx_INCREF(__pyx_n_s_ordered_dict);
  __Pyx_GIVEREF(__pyx_n_s_ordered_dict);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_ordered_dict);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_1) < 0) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_1) < 0) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ordered_dict, __pyx_t_1) < 0) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":40
 * 
 * # Initialize NumPy C API
 * arrow_init_numpy()             # <<<<<<<<<<<<<<
 * # Initialize PyArrow C++ API
 * # (used from some of our C++ code, see e.g. ARROW-5260)
 */
  __pyx_t_3 = arrow_init_numpy(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 40, __pyx_L1_error)

  /* "pyarrow/lib.pyx":43
 * # Initialize PyArrow C++ API
 * # (used from some of our C++ code, see e.g. ARROW-5260)
 * import_pyarrow()             # <<<<<<<<<<<<<<
 * set_numpy_nan(np.nan)
 * 
 */
  __pyx_t_3 = arrow::py::import_pyarrow(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 43, __pyx_L1_error)

  /* "pyarrow/lib.pyx":44
 * # (used from some of our C++ code, see e.g. ARROW-5260)
 * import_pyarrow()
 * set_numpy_nan(np.nan)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  arrow::py::set_numpy_nan(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_1cpu_count, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cpu_count, __pyx_t_1) < 0) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_3set_cpu_count, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cpu_count, __pyx_t_1) < 0) __PYX_ERR(8, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":69
 * 
 * 
 * Type_NA = _Type_NA             # <<<<<<<<<<<<<<
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_NA, __pyx_t_1) < 0) __PYX_ERR(8, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":70
 * 
 * Type_NA = _Type_NA
 * Type_BOOL = _Type_BOOL             # <<<<<<<<<<<<<<
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BOOL, __pyx_t_1) < 0) __PYX_ERR(8, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":71
 * Type_NA = _Type_NA
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8             # <<<<<<<<<<<<<<
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT8, __pyx_t_1) < 0) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":72
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8             # <<<<<<<<<<<<<<
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT8, __pyx_t_1) < 0) __PYX_ERR(8, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":73
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16             # <<<<<<<<<<<<<<
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT16, __pyx_t_1) < 0) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":74
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16             # <<<<<<<<<<<<<<
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT16, __pyx_t_1) < 0) __PYX_ERR(8, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":75
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32             # <<<<<<<<<<<<<<
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT32, __pyx_t_1) < 0) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":76
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32             # <<<<<<<<<<<<<<
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT32, __pyx_t_1) < 0) __PYX_ERR(8, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":77
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64             # <<<<<<<<<<<<<<
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT64, __pyx_t_1) < 0) __PYX_ERR(8, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":78
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64             # <<<<<<<<<<<<<<
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT64, __pyx_t_1) < 0) __PYX_ERR(8, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":79
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT             # <<<<<<<<<<<<<<
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_HALF_FLOAT, __pyx_t_1) < 0) __PYX_ERR(8, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":80
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT             # <<<<<<<<<<<<<<
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FLOAT, __pyx_t_1) < 0) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":81
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE             # <<<<<<<<<<<<<<
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DOUBLE, __pyx_t_1) < 0) __PYX_ERR(8, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":82
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL             # <<<<<<<<<<<<<<
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DECIMAL, __pyx_t_1) < 0) __PYX_ERR(8, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":83
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32             # <<<<<<<<<<<<<<
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE32, __pyx_t_1) < 0) __PYX_ERR(8, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":84
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64             # <<<<<<<<<<<<<<
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE64, __pyx_t_1) < 0) __PYX_ERR(8, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":85
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP             # <<<<<<<<<<<<<<
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIMESTAMP, __pyx_t_1) < 0) __PYX_ERR(8, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":86
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32             # <<<<<<<<<<<<<<
 * Type_TIME64 = _Type_TIME64
 * Type_BINARY = _Type_BINARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME32, __pyx_t_1) < 0) __PYX_ERR(8, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":87
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64             # <<<<<<<<<<<<<<
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME64, __pyx_t_1) < 0) __PYX_ERR(8, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":88
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64
 * Type_BINARY = _Type_BINARY             # <<<<<<<<<<<<<<
 * Type_STRING = _Type_STRING
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BINARY, __pyx_t_1) < 0) __PYX_ERR(8, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":89
 * Type_TIME64 = _Type_TIME64
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING             # <<<<<<<<<<<<<<
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 * Type_LARGE_STRING = _Type_LARGE_STRING
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRING, __pyx_t_1) < 0) __PYX_ERR(8, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":90
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING
 * Type_LARGE_BINARY = _Type_LARGE_BINARY             # <<<<<<<<<<<<<<
 * Type_LARGE_STRING = _Type_LARGE_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LARGE_BINARY, __pyx_t_1) < 0) __PYX_ERR(8, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":91
 * Type_STRING = _Type_STRING
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 * Type_LARGE_STRING = _Type_LARGE_STRING             # <<<<<<<<<<<<<<
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_LIST
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LARGE_STRING, __pyx_t_1) < 0) __PYX_ERR(8, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":92
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 * Type_LARGE_STRING = _Type_LARGE_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY             # <<<<<<<<<<<<<<
 * Type_LIST = _Type_LIST
 * Type_LARGE_LIST = _Type_LARGE_LIST
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FIXED_SIZE_BINARY, __pyx_t_1) < 0) __PYX_ERR(8, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":93
 * Type_LARGE_STRING = _Type_LARGE_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_LIST             # <<<<<<<<<<<<<<
 * Type_LARGE_LIST = _Type_LARGE_LIST
 * Type_STRUCT = _Type_STRUCT
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LIST, __pyx_t_1) < 0) __PYX_ERR(8, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":94
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_LIST
 * Type_LARGE_LIST = _Type_LARGE_LIST             # <<<<<<<<<<<<<<
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_LIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LARGE_LIST, __pyx_t_1) < 0) __PYX_ERR(8, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":95
 * Type_LIST = _Type_LIST
 * Type_LARGE_LIST = _Type_LARGE_LIST
 * Type_STRUCT = _Type_STRUCT             # <<<<<<<<<<<<<<
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRUCT, __pyx_t_1) < 0) __PYX_ERR(8, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":96
 * Type_LARGE_LIST = _Type_LARGE_LIST
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION             # <<<<<<<<<<<<<<
 * Type_DICTIONARY = _Type_DICTIONARY
 * Type_MAP = _Type_MAP
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UNION, __pyx_t_1) < 0) __PYX_ERR(8, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":97
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY             # <<<<<<<<<<<<<<
 * Type_MAP = _Type_MAP
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DICTIONARY, __pyx_t_1) < 0) __PYX_ERR(8, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":98
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY
 * Type_MAP = _Type_MAP             # <<<<<<<<<<<<<<
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::MAP); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_MAP, __pyx_t_1) < 0) __PYX_ERR(8, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":100
 * Type_MAP = _Type_MAP
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE             # <<<<<<<<<<<<<<
 * UnionMode_DENSE = _UnionMode_DENSE
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_SPARSE, __pyx_t_1) < 0) __PYX_ERR(8, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":101
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 * UnionMode_DENSE = _UnionMode_DENSE             # <<<<<<<<<<<<<<
 * 
 * # pandas API shim
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_DENSE, __pyx_t_1) < 0) __PYX_ERR(8, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":198
 * 
 * 
 * cdef _PandasAPIShim pandas_api = _PandasAPIShim()             # <<<<<<<<<<<<<<
 * _pandas_api = pandas_api
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasAPIShim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib_pandas_api, ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":199
 * 
 * cdef _PandasAPIShim pandas_api = _PandasAPIShim()
 * _pandas_api = pandas_api             # <<<<<<<<<<<<<<
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pandas_api, ((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api)) < 0) __PYX_ERR(3, 199, __pyx_L1_error)

  /* "pyarrow/error.pxi":20
 * from pyarrow.includes.libarrow cimport CStatus, IsPyError, RestorePyError
 * from pyarrow.includes.common cimport c_string
 * from pyarrow.compat import frombytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_frombytes);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":23
 * 
 * 
 * class ArrowException(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowException, __pyx_n_s_ArrowException, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowException, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowException, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":27
 * 
 * 
 * class ArrowInvalid(ValueError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_builtin_ValueError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowInvalid, __pyx_n_s_ArrowInvalid, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowInvalid, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowInvalid, __pyx_t_5) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":31
 * 
 * 
 * class ArrowMemoryError(MemoryError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_MemoryError);
  __Pyx_GIVEREF(__pyx_builtin_MemoryError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_MemoryError);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowMemoryError, __pyx_n_s_ArrowMemoryError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowMemoryError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowMemoryError, __pyx_t_5) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":35
 * 
 * 
 * class ArrowIOError(IOError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_IOError);
  __Pyx_GIVEREF(__pyx_builtin_IOError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_IOError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowIOError, __pyx_n_s_ArrowIOError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowIOError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowIOError, __pyx_t_5) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":39
 * 
 * 
 * class ArrowKeyError(KeyError, ArrowException):             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         # Override KeyError.__str__, as it uses the repr() of the key
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_builtin_KeyError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowKeyError, __pyx_n_s_ArrowKeyError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/error.pxi":40
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13ArrowKeyError_1__str__, 0, __pyx_n_s_ArrowKeyError___str, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_str, __pyx_t_5) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/error.pxi":39
 * 
 * 
 * class ArrowKeyError(KeyError, ArrowException):             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         # Override KeyError.__str__, as it uses the repr() of the key
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowKeyError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowKeyError, __pyx_t_5) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":45
 * 
 * 
 * class ArrowTypeError(TypeError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_builtin_TypeError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowTypeError, __pyx_n_s_ArrowTypeError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowTypeError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowTypeError, __pyx_t_5) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":49
 * 
 * 
 * class ArrowNotImplementedError(NotImplementedError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __Pyx_GIVEREF(__pyx_builtin_NotImplementedError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_NotImplementedError);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowNotImplementedError, __pyx_n_s_ArrowNotImplementedError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowNotImplementedError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowNotImplementedError, __pyx_t_5) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":53
 * 
 * 
 * class ArrowCapacityError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowCapacityError, __pyx_n_s_ArrowCapacityError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowCapacityError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowCapacityError, __pyx_t_5) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":57
 * 
 * 
 * class ArrowIndexError(IndexError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_IndexError);
  __Pyx_GIVEREF(__pyx_builtin_IndexError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_IndexError);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowIndexError, __pyx_n_s_ArrowIndexError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowIndexError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowIndexError, __pyx_t_5) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":61
 * 
 * 
 * class ArrowSerializationError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowSerializationError, __pyx_n_s_ArrowSerializationError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowSerializationError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowSerializationError, __pyx_t_5) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5default_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_memory_pool, __pyx_t_1) < 0) __PYX_ERR(10, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_7proxy_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proxy_memory_pool, __pyx_t_1) < 0) __PYX_ERR(10, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_9logging_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging_memory_pool, __pyx_t_1) < 0) __PYX_ERR(10, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11set_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_memory_pool, __pyx_t_1) < 0) __PYX_ERR(10, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":127
 * 
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()             # <<<<<<<<<<<<<<
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(
 *     _default_memory_pool)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_memory_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(10, 127, __pyx_L1_error)
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__default_memory_pool, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":128
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(             # <<<<<<<<<<<<<<
 *     _default_memory_pool)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging_memory_pool); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/memory.pxi":129
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(
 *     _default_memory_pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":128
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(             # <<<<<<<<<<<<<<
 *     _default_memory_pool)
 * 
 */
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_LoggingMemoryPool))))) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__logging_memory_pool, ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13log_memory_allocations, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_log_memory_allocations, __pyx_t_1) < 0) __PYX_ERR(10, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15total_allocated_bytes, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_allocated_bytes, __pyx_t_1) < 0) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_17jemalloc_set_decay_ms, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jemalloc_set_decay_ms, __pyx_t_1) < 0) __PYX_ERR(10, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":18
 * # under the License.
 * 
 * import atexit             # <<<<<<<<<<<<<<
 * import re
 * import warnings
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_atexit, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_atexit, __pyx_t_1) < 0) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":19
 * 
 * import atexit
 * import re             # <<<<<<<<<<<<<<
 * import warnings
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":20
 * import atexit
 * import re
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * from pyarrow import compat
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) __PYX_ERR(4, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":22
 * import warnings
 * 
 * from pyarrow import compat             # <<<<<<<<<<<<<<
 * from pyarrow.compat import builtin_pickle
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_compat);
  __Pyx_GIVEREF(__pyx_n_s_compat);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_compat);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compat); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat, __pyx_t_1) < 0) __PYX_ERR(4, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":23
 * 
 * from pyarrow import compat
 * from pyarrow.compat import builtin_pickle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_builtin_pickle);
  __Pyx_GIVEREF(__pyx_n_s_builtin_pickle);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_builtin_pickle);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtin_pickle, __pyx_t_2) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":29
 * # of nulls
 * cdef dict _pandas_type_map = {
 *     _Type_NA: np.float64,  # NaNs             # <<<<<<<<<<<<<<
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(21); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":30
 * cdef dict _pandas_type_map = {
 *     _Type_NA: np.float64,  # NaNs
 *     _Type_BOOL: np.bool_,             # <<<<<<<<<<<<<<
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":31
 *     _Type_NA: np.float64,  # NaNs
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,             # <<<<<<<<<<<<<<
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":32
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,             # <<<<<<<<<<<<<<
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":33
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,             # <<<<<<<<<<<<<<
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":34
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":35
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":36
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":37
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":38
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":39
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":40
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":41
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":42
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":43
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_BINARY: np.object_,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":44
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__284, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":45
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_BINARY: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":46
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":47
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_LIST: np.object_,
 *     _Type_DECIMAL: np.object_,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":48
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: np.object_,
 * }
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":49
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,
 *     _Type_DECIMAL: np.object_,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_5) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__pandas_type_map);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__pandas_type_map, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":53
 * 
 * cdef dict _pep3118_type_map = {
 *     _Type_INT8: b'b',             # <<<<<<<<<<<<<<
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_b) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":54
 * cdef dict _pep3118_type_map = {
 *     _Type_INT8: b'b',
 *     _Type_INT16: b'h',             # <<<<<<<<<<<<<<
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_h) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":55
 *     _Type_INT8: b'b',
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',             # <<<<<<<<<<<<<<
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_i) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":56
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',             # <<<<<<<<<<<<<<
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_q) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":57
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',             # <<<<<<<<<<<<<<
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_B) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":58
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',             # <<<<<<<<<<<<<<
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_H) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":59
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',             # <<<<<<<<<<<<<<
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_I) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":60
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_Q) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":61
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: b'f',
 *     _Type_DOUBLE: b'd',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_e) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":62
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: b'd',
 * }
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_f) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":63
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',
 *     _Type_DOUBLE: b'd',             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_d) < 0) __PYX_ERR(4, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__pep3118_type_map);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__pep3118_type_map, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":84
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_19_is_primitive, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_primitive, __pyx_t_1) < 0) __PYX_ERR(4, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":604
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         """
 *         Return an extension type instance from the storage type and serialized
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType, __pyx_n_s_arrow_ext_deserialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":603
 *         return NotImplementedError
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):
 *         """
 */
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType->tp_dict, __pyx_n_s_arrow_ext_deserialize, __pyx_t_5) < 0) __PYX_ERR(4, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ExtensionType);

  /* "pyarrow/types.pxi":638
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 */
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType, __pyx_n_s_arrow_ext_deserialize); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/types.pxi":637
 *         return builtin_pickle.dumps(self)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType->tp_dict, __pyx_n_s_arrow_ext_deserialize, __pyx_t_1) < 0) __PYX_ERR(4, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_PyExtensionType);

  /* "pyarrow/types.pxi":672
 * 
 * 
 * _python_extension_types_registry = []             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_python_extension_types_registry, __pyx_t_1) < 0) __PYX_ERR(4, 672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":675
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_21register_extension_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_extension_type, __pyx_t_1) < 0) __PYX_ERR(4, 675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":704
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_23unregister_extension_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unregister_extension_type, __pyx_t_1) < 0) __PYX_ERR(4, 704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":963
 * 
 *     @classmethod
 *     def from_pandas(cls, df, preserve_index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_7pyarrow_3lib_Schema, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":962
 *                                            check_metadata)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, preserve_index=None):
 *         """
 */
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Schema->tp_dict, __pyx_n_s_from_pandas, __pyx_t_5) < 0) __PYX_ERR(4, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Schema);

  /* "pyarrow/types.pxi":1252
 * 
 * 
 * cdef dict _type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__type_cache, ((PyObject*)__pyx_t_5));
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":1270
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_25field, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_field, __pyx_t_5) < 0) __PYX_ERR(4, 1270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":1306
 * 
 * cdef set PRIMITIVE_TYPES = set([
 *     _Type_NA, _Type_BOOL,             # <<<<<<<<<<<<<<
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":1307
 * cdef set PRIMITIVE_TYPES = set([
 *     _Type_NA, _Type_BOOL,
 *     _Type_UINT8, _Type_INT8,             # <<<<<<<<<<<<<<
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/types.pxi":1308
 *     _Type_NA, _Type_BOOL,
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,             # <<<<<<<<<<<<<<
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,
 */
  __pyx_t_6 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/types.pxi":1309
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,             # <<<<<<<<<<<<<<
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,
 */
  __pyx_t_8 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/types.pxi":1310
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,
 */
  __pyx_t_10 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "pyarrow/types.pxi":1311
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,             # <<<<<<<<<<<<<<
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,
 */
  __pyx_t_12 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "pyarrow/types.pxi":1312
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,             # <<<<<<<<<<<<<<
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,
 */
  __pyx_t_14 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "pyarrow/types.pxi":1313
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,
 */
  __pyx_t_16 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);

  /* "pyarrow/types.pxi":1314
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT,
 *     _Type_DOUBLE])
 */
  __pyx_t_17 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);

  /* "pyarrow/types.pxi":1315
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE])
 * 
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/types.pxi":1316
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,
 *     _Type_DOUBLE])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = PySet_New(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PySet_Add(__pyx_t_20, __pyx_t_5) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_1) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_4) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_2) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_6) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_7) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_8) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_9) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_10) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_11) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_12) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_13) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_14) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_15) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_16) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_17) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_18) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_19) < 0) __PYX_ERR(4, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1319
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_27null, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_null, __pyx_t_20) < 0) __PYX_ERR(4, 1319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1326
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_29bool_, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bool, __pyx_t_20) < 0) __PYX_ERR(4, 1326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1333
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31uint8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint8, __pyx_t_20) < 0) __PYX_ERR(4, 1333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1340
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_33int8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int8, __pyx_t_20) < 0) __PYX_ERR(4, 1340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1347
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_35uint16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint16, __pyx_t_20) < 0) __PYX_ERR(4, 1347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1354
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_37int16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __pyx_t_20) < 0) __PYX_ERR(4, 1354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1361
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_39uint32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint32, __pyx_t_20) < 0) __PYX_ERR(4, 1361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1368
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_41int32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int32, __pyx_t_20) < 0) __PYX_ERR(4, 1368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1375
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_43uint64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint64, __pyx_t_20) < 0) __PYX_ERR(4, 1375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1382
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_45int64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __pyx_t_20) < 0) __PYX_ERR(4, 1382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1389
 * 
 * 
 * cdef dict _timestamp_type_cache = {}             # <<<<<<<<<<<<<<
 * cdef dict _time_type_cache = {}
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__timestamp_type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__timestamp_type_cache, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1390
 * 
 * cdef dict _timestamp_type_cache = {}
 * cdef dict _time_type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__time_type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__time_type_cache, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1404
 * 
 * 
 * _FIXED_OFFSET_RE = re.compile(r'([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_re); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_compile); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__303, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FIXED_OFFSET_RE, __pyx_t_20) < 0) __PYX_ERR(4, 1404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1407
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_47tzinfo_to_string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tzinfo_to_string, __pyx_t_20) < 0) __PYX_ERR(4, 1407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1453
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_49string_to_tzinfo, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_to_tzinfo, __pyx_t_20) < 0) __PYX_ERR(4, 1453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1481
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_51timestamp, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timestamp, __pyx_t_20) < 0) __PYX_ERR(4, 1481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1536
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_53time32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time32, __pyx_t_20) < 0) __PYX_ERR(4, 1536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1574
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_55time64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time64, __pyx_t_20) < 0) __PYX_ERR(4, 1574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1612
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_57date32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date32, __pyx_t_20) < 0) __PYX_ERR(4, 1612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1619
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_59date64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date64, __pyx_t_20) < 0) __PYX_ERR(4, 1619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1626
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_61float16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float16, __pyx_t_20) < 0) __PYX_ERR(4, 1626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1633
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_63float32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __pyx_t_20) < 0) __PYX_ERR(4, 1633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1640
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_65float64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float64, __pyx_t_20) < 0) __PYX_ERR(4, 1640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1667
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_69string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_20) < 0) __PYX_ERR(4, 1667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1674
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_71utf8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf8, __pyx_t_20) < 0) __PYX_ERR(4, 1674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1681
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_73binary, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binary, __pyx_t_20) < 0) __PYX_ERR(4, 1681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1700
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_75large_binary, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_large_binary, __pyx_t_20) < 0) __PYX_ERR(4, 1700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1710
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_77large_string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_large_string, __pyx_t_20) < 0) __PYX_ERR(4, 1710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1720
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_79large_utf8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_large_utf8, __pyx_t_20) < 0) __PYX_ERR(4, 1720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1820
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_87struct, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_20) < 0) __PYX_ERR(4, 1820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1868
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_89union, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_union, __pyx_t_20) < 0) __PYX_ERR(4, 1868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1915
 * 
 * cdef dict _type_aliases = {
 *     'null': null,             # <<<<<<<<<<<<<<
 *     'bool': bool_,
 *     'boolean': bool_,
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(48); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_null); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_null, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1916
 * cdef dict _type_aliases = {
 *     'null': null,
 *     'bool': bool_,             # <<<<<<<<<<<<<<
 *     'boolean': bool_,
 *     'i1': int8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_bool); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_bool_2, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1917
 *     'null': null,
 *     'bool': bool_,
 *     'boolean': bool_,             # <<<<<<<<<<<<<<
 *     'i1': int8,
 *     'int8': int8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_bool); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_boolean, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1918
 *     'bool': bool_,
 *     'boolean': bool_,
 *     'i1': int8,             # <<<<<<<<<<<<<<
 *     'int8': int8,
 *     'i2': int16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i1, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1919
 *     'boolean': bool_,
 *     'i1': int8,
 *     'int8': int8,             # <<<<<<<<<<<<<<
 *     'i2': int16,
 *     'int16': int16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int8, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1920
 *     'i1': int8,
 *     'int8': int8,
 *     'i2': int16,             # <<<<<<<<<<<<<<
 *     'int16': int16,
 *     'i4': int32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i2, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1921
 *     'int8': int8,
 *     'i2': int16,
 *     'int16': int16,             # <<<<<<<<<<<<<<
 *     'i4': int32,
 *     'int32': int32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int16, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1922
 *     'i2': int16,
 *     'int16': int16,
 *     'i4': int32,             # <<<<<<<<<<<<<<
 *     'int32': int32,
 *     'i8': int64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i4, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1923
 *     'int16': int16,
 *     'i4': int32,
 *     'int32': int32,             # <<<<<<<<<<<<<<
 *     'i8': int64,
 *     'int64': int64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int32, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1924
 *     'i4': int32,
 *     'int32': int32,
 *     'i8': int64,             # <<<<<<<<<<<<<<
 *     'int64': int64,
 *     'u1': uint8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i8, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1925
 *     'int32': int32,
 *     'i8': int64,
 *     'int64': int64,             # <<<<<<<<<<<<<<
 *     'u1': uint8,
 *     'uint8': uint8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int64, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1926
 *     'i8': int64,
 *     'int64': int64,
 *     'u1': uint8,             # <<<<<<<<<<<<<<
 *     'uint8': uint8,
 *     'u2': uint16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u1, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1927
 *     'int64': int64,
 *     'u1': uint8,
 *     'uint8': uint8,             # <<<<<<<<<<<<<<
 *     'u2': uint16,
 *     'uint16': uint16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint8, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1928
 *     'u1': uint8,
 *     'uint8': uint8,
 *     'u2': uint16,             # <<<<<<<<<<<<<<
 *     'uint16': uint16,
 *     'u4': uint32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u2, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1929
 *     'uint8': uint8,
 *     'u2': uint16,
 *     'uint16': uint16,             # <<<<<<<<<<<<<<
 *     'u4': uint32,
 *     'uint32': uint32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint16, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1930
 *     'u2': uint16,
 *     'uint16': uint16,
 *     'u4': uint32,             # <<<<<<<<<<<<<<
 *     'uint32': uint32,
 *     'u8': uint64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u4, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1931
 *     'uint16': uint16,
 *     'u4': uint32,
 *     'uint32': uint32,             # <<<<<<<<<<<<<<
 *     'u8': uint64,
 *     'uint64': uint64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint32, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1932
 *     'u4': uint32,
 *     'uint32': uint32,
 *     'u8': uint64,             # <<<<<<<<<<<<<<
 *     'uint64': uint64,
 *     'f2': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u8, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1933
 *     'uint32': uint32,
 *     'u8': uint64,
 *     'uint64': uint64,             # <<<<<<<<<<<<<<
 *     'f2': float16,
 *     'halffloat': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint64, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1934
 *     'u8': uint64,
 *     'uint64': uint64,
 *     'f2': float16,             # <<<<<<<<<<<<<<
 *     'halffloat': float16,
 *     'float16': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f2, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1935
 *     'uint64': uint64,
 *     'f2': float16,
 *     'halffloat': float16,             # <<<<<<<<<<<<<<
 *     'float16': float16,
 *     'f4': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_halffloat, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1936
 *     'f2': float16,
 *     'halffloat': float16,
 *     'float16': float16,             # <<<<<<<<<<<<<<
 *     'f4': float32,
 *     'float': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float16, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1937
 *     'halffloat': float16,
 *     'float16': float16,
 *     'f4': float32,             # <<<<<<<<<<<<<<
 *     'float': float32,
 *     'float32': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f4, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1938
 *     'float16': float16,
 *     'f4': float32,
 *     'float': float32,             # <<<<<<<<<<<<<<
 *     'float32': float32,
 *     'f8': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1939
 *     'f4': float32,
 *     'float': float32,
 *     'float32': float32,             # <<<<<<<<<<<<<<
 *     'f8': float64,
 *     'double': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float32, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1940
 *     'float': float32,
 *     'float32': float32,
 *     'f8': float64,             # <<<<<<<<<<<<<<
 *     'double': float64,
 *     'float64': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f8, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1941
 *     'float32': float32,
 *     'f8': float64,
 *     'double': float64,             # <<<<<<<<<<<<<<
 *     'float64': float64,
 *     'string': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_double, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1942
 *     'f8': float64,
 *     'double': float64,
 *     'float64': float64,             # <<<<<<<<<<<<<<
 *     'string': string,
 *     'str': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float64, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1943
 *     'double': float64,
 *     'float64': float64,
 *     'string': string,             # <<<<<<<<<<<<<<
 *     'str': string,
 *     'utf8': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_string, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1944
 *     'float64': float64,
 *     'string': string,
 *     'str': string,             # <<<<<<<<<<<<<<
 *     'utf8': string,
 *     'binary': binary,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_str_2, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1945
 *     'string': string,
 *     'str': string,
 *     'utf8': string,             # <<<<<<<<<<<<<<
 *     'binary': binary,
 *     'large_string': large_string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_utf8, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1946
 *     'str': string,
 *     'utf8': string,
 *     'binary': binary,             # <<<<<<<<<<<<<<
 *     'large_string': large_string,
 *     'large_str': large_string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_binary); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_binary, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1947
 *     'utf8': string,
 *     'binary': binary,
 *     'large_string': large_string,             # <<<<<<<<<<<<<<
 *     'large_str': large_string,
 *     'large_utf8': large_string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_string, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1948
 *     'binary': binary,
 *     'large_string': large_string,
 *     'large_str': large_string,             # <<<<<<<<<<<<<<
 *     'large_utf8': large_string,
 *     'large_binary': large_binary,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_str, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1949
 *     'large_string': large_string,
 *     'large_str': large_string,
 *     'large_utf8': large_string,             # <<<<<<<<<<<<<<
 *     'large_binary': large_binary,
 *     'date32': date32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_utf8, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1950
 *     'large_str': large_string,
 *     'large_utf8': large_string,
 *     'large_binary': large_binary,             # <<<<<<<<<<<<<<
 *     'date32': date32,
 *     'date64': date64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_binary); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_binary, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1951
 *     'large_utf8': large_string,
 *     'large_binary': large_binary,
 *     'date32': date32,             # <<<<<<<<<<<<<<
 *     'date64': date64,
 *     'date32[day]': date32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_date32, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1952
 *     'large_binary': large_binary,
 *     'date32': date32,
 *     'date64': date64,             # <<<<<<<<<<<<<<
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_date64, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1953
 *     'date32': date32,
 *     'date64': date64,
 *     'date32[day]': date32,             # <<<<<<<<<<<<<<
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_date32_day, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1954
 *     'date64': date64,
 *     'date32[day]': date32,
 *     'date64[ms]': date64,             # <<<<<<<<<<<<<<
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_date64_ms, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1955
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),             # <<<<<<<<<<<<<<
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_time32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__330, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time32_s, __pyx_t_18) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1956
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),             # <<<<<<<<<<<<<<
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_time32); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__331, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time32_ms, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1957
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),             # <<<<<<<<<<<<<<
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_time64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__332, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time64_us, __pyx_t_18) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1958
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),             # <<<<<<<<<<<<<<
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_time64); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__333, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time64_ns, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1959
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),             # <<<<<<<<<<<<<<
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__330, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_s, __pyx_t_18) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1960
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),             # <<<<<<<<<<<<<<
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__331, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_ms, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1961
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),             # <<<<<<<<<<<<<<
 *     'timestamp[ns]': timestamp('ns'),
 * }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__332, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_us, __pyx_t_18) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1962
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__333, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_ns, __pyx_t_19) < 0) __PYX_ERR(4, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__type_aliases);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__type_aliases, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1966
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_91type_for_alias, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_type_for_alias, __pyx_t_20) < 0) __PYX_ERR(4, 1966, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1996
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_93schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_schema, __pyx_t_20) < 0) __PYX_ERR(4, 1996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2052
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_95from_numpy_dtype, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_from_numpy_dtype, __pyx_t_20) < 0) __PYX_ERR(4, 2052, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2064
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_97is_boolean_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_boolean_value, __pyx_t_20) < 0) __PYX_ERR(4, 2064, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2068
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_99is_integer_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer_value, __pyx_t_20) < 0) __PYX_ERR(4, 2068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2072
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_101is_float_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_float_value, __pyx_t_20) < 0) __PYX_ERR(4, 2072, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2088
 * 
 * 
 * _registry_nanny = _ExtensionRegistryNanny()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__ExtensionRegistryNanny)); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_registry_nanny, __pyx_t_20) < 0) __PYX_ERR(4, 2088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2091
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_103_register_py_extension_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_py_extension_type, __pyx_t_20) < 0) __PYX_ERR(4, 2091, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2106
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_105_unregister_py_extension_types, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unregister_py_extension_types, __pyx_t_20) < 0) __PYX_ERR(4, 2106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2120
 * 
 * 
 * _register_py_extension_type()             # <<<<<<<<<<<<<<
 * atexit.register(_unregister_py_extension_types)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_register_py_extension_type); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2121
 * 
 * _register_py_extension_type()
 * atexit.register(_unregister_py_extension_types)             # <<<<<<<<<<<<<<
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_atexit); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_register); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_unregister_py_extension_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":19
 * 
 * 
 * _NULL = NA = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_2, Py_None) < 0) __PYX_ERR(5, 19, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, Py_None) < 0) __PYX_ERR(5, 19, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":53
 * 
 * 
 * _NULL = NA = NullType()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NullType)); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_2, __pyx_t_18) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, __pyx_t_18) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":299
 * 
 * 
 * cdef dict _DATETIME_CONVERSION_FUNCTIONS = {}             # <<<<<<<<<<<<<<
 * cdef c_bool _datetime_conversion_initialized = False
 * 
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, ((PyObject*)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":300
 * 
 * cdef dict _DATETIME_CONVERSION_FUNCTIONS = {}
 * cdef c_bool _datetime_conversion_initialized = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_7pyarrow_3lib__datetime_conversion_initialized = 0;

  /* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_111_nanoseconds_to_datetime_safe, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nanoseconds_to_datetime_safe, __pyx_t_18) < 0) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_113_microseconds_to_datetime, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_microseconds_to_datetime, __pyx_t_18) < 0) __PYX_ERR(5, 330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_115_millis_to_datetime, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_millis_to_datetime, __pyx_t_18) < 0) __PYX_ERR(5, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_117_seconds_to_datetime, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_seconds_to_datetime, __pyx_t_18) < 0) __PYX_ERR(5, 342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_119_datetime_conversion_functions, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_conversion_functions, __pyx_t_18) < 0) __PYX_ERR(5, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":799
 * 
 * cdef dict _array_value_classes = {
 *     _Type_BOOL: BooleanValue,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(28); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BooleanValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":800
 * cdef dict _array_value_classes = {
 *     _Type_BOOL: BooleanValue,
 *     _Type_UINT8: UInt8Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":801
 *     _Type_BOOL: BooleanValue,
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":802
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":803
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":804
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":805
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":806
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":807
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":808
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,             # <<<<<<<<<<<<<<
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date32Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":809
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,             # <<<<<<<<<<<<<<
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date64Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":810
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,             # <<<<<<<<<<<<<<
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time32Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":811
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: TimestampValue,
 *     _Type_HALF_FLOAT: HalfFloatValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time64Value)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":812
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_TimestampValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":813
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,
 *     _Type_HALF_FLOAT: HalfFloatValue,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_HalfFloatValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":814
 *     _Type_TIMESTAMP: TimestampValue,
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":815
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,             # <<<<<<<<<<<<<<
 *     _Type_LIST: ListValue,
 *     _Type_LARGE_LIST: LargeListValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":816
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_LIST: LargeListValue,
 *     _Type_UNION: UnionValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ListValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":817
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,
 *     _Type_LARGE_LIST: LargeListValue,             # <<<<<<<<<<<<<<
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_LIST); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":818
 *     _Type_LIST: ListValue,
 *     _Type_LARGE_LIST: LargeListValue,
 *     _Type_UNION: UnionValue,             # <<<<<<<<<<<<<<
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":819
 *     _Type_LARGE_LIST: LargeListValue,
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,             # <<<<<<<<<<<<<<
 *     _Type_STRING: StringValue,
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BinaryValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":820
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 *     _Type_LARGE_STRING: LargeStringValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StringValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":821
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,
 *     _Type_LARGE_BINARY: LargeBinaryValue,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_STRING: LargeStringValue,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_BINARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeBinaryValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":822
 *     _Type_STRING: StringValue,
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 *     _Type_LARGE_STRING: LargeStringValue,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_STRING); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":823
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 *     _Type_LARGE_STRING: LargeStringValue,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":824
 *     _Type_LARGE_STRING: LargeStringValue,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,             # <<<<<<<<<<<<<<
 *     _Type_STRUCT: StructValue,
 *     _Type_DICTIONARY: DictionaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DecimalValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":825
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,             # <<<<<<<<<<<<<<
 *     _Type_DICTIONARY: DictionaryValue,
 * }
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StructValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":826
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,
 *     _Type_DICTIONARY: DictionaryValue,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryValue)) < 0) __PYX_ERR(5, 799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__array_value_classes);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__array_value_classes, ((PyObject*)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":996
 * 
 * cdef dict _scalar_classes = {
 *     _Type_UINT8: UInt8Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":997
 * cdef dict _scalar_classes = {
 *     _Type_UINT8: UInt8Scalar,
 *     _Type_UINT16: UInt16Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":998
 *     _Type_UINT8: UInt8Scalar,
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":999
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1000
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1001
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1002
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1003
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatScalar,
 *     _Type_DOUBLE: DoubleScalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Scalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1004
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleScalar,
 * }
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatScalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1005
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,
 *     _Type_DOUBLE: DoubleScalar,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleScalar)) < 0) __PYX_ERR(5, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__scalar_classes);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__scalar_classes, ((PyObject*)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_121_ndarray_to_arrow_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ndarray_to_arrow_type, __pyx_t_18) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":87
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_123_handle_arrow_array_protocol, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_handle_arrow_array_protocol, __pyx_t_18) < 0) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":99
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_125array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_18) < 0) __PYX_ERR(1, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":214
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_127asarray, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asarray, __pyx_t_18) < 0) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":240
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_129infer_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_infer_type, __pyx_t_18) < 0) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":269
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_131_normalize_slice, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_slice, __pyx_t_18) < 0) __PYX_ERR(1, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":315
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))
 * 
 * cdef _FunctionContext _global_ctx = _FunctionContext()             # <<<<<<<<<<<<<<
 * 
 * cdef CFunctionContext* _context() nogil:
 */
  __pyx_t_18 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__FunctionContext)); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__global_ctx));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__global_ctx, ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":404
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_133_restore_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_restore_array, __pyx_t_18) < 0) __PYX_ERR(1, 404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":629
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Array_19from_pandas, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_pandas, __pyx_t_18) < 0) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":628
 *         return wrap_datum(out)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Array, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_pandas, __pyx_t_19) < 0) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":669
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Array_23from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":668
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,
 *                      children=None):
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Array, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_buffers, __pyx_t_18) < 0) __PYX_ERR(1, 669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":1156
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_9ListArray_1from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":1155
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(offsets, values, MemoryPool pool=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":1209
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and values
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_14LargeListArray_1from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeListArray);

  /* "pyarrow/array.pxi":1208
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(offsets, values, MemoryPool pool=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeListArray);

  /* "pyarrow/array.pxi":1256
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10UnionArray_1from_dense, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_dense, __pyx_t_18) < 0) __PYX_ERR(1, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1255
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dense(Array types, Array value_offsets, list children,
 *                    list field_names=None, list type_codes=None):
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray, __pyx_n_s_from_dense); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_dense, __pyx_t_19) < 0) __PYX_ERR(1, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1296
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10UnionArray_3from_sparse, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_sparse, __pyx_t_19) < 0) __PYX_ERR(1, 1296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1295
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_sparse(Array types, list children, list field_names=None,
 *                     list type_codes=None):
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray, __pyx_n_s_from_sparse); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_sparse, __pyx_t_18) < 0) __PYX_ERR(1, 1296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1342
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11StringArray_1from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_18) < 0) __PYX_ERR(1, 1342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":1341
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 1342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":1374
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16LargeStringArray_1from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 1374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeStringArray);

  /* "pyarrow/array.pxi":1373
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_18) < 0) __PYX_ERR(1, 1374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeStringArray);

  /* "pyarrow/array.pxi":1439
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15DictionaryArray_3from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1438
 *         return self._indices
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1572
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11StructArray_5from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1571
 *         return [pyarrow_wrap_array(arr) for arr in arrays]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None, fields=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1653
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_14ExtensionArray_1from_storage, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray->tp_dict, __pyx_n_s_from_storage, __pyx_t_18) < 0) __PYX_ERR(1, 1653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ExtensionArray);

  /* "pyarrow/array.pxi":1652
 *         return pyarrow_wrap_array(ext_array.storage())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_storage(BaseExtensionType typ, Array storage):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray, __pyx_n_s_from_storage); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray->tp_dict, __pyx_n_s_from_storage, __pyx_t_19) < 0) __PYX_ERR(1, 1653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ExtensionArray);

  /* "pyarrow/array.pxi":1682
 * 
 * cdef dict _array_classes = {
 *     _Type_NA: NullArray,             # <<<<<<<<<<<<<<
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,
 */
  __pyx_t_19 = __Pyx_PyDict_NewPresized(30); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_NullArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1683
 * cdef dict _array_classes = {
 *     _Type_NA: NullArray,
 *     _Type_BOOL: BooleanArray,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BooleanArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1684
 *     _Type_NA: NullArray,
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1685
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1686
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1687
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1688
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1689
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1690
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1691
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1692
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,             # <<<<<<<<<<<<<<
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date32Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1693
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date64Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1694
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,             # <<<<<<<<<<<<<<
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_TimestampArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1695
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,             # <<<<<<<<<<<<<<
 *     _Type_TIME64: Time64Array,
 *     _Type_HALF_FLOAT: HalfFloatArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time32Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1696
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time64Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1697
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,
 *     _Type_HALF_FLOAT: HalfFloatArray,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_HalfFloatArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1698
 *     _Type_TIME64: Time64Array,
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1699
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,             # <<<<<<<<<<<<<<
 *     _Type_LIST: ListArray,
 *     _Type_LARGE_LIST: LargeListArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1700
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_LIST: LargeListArray,
 *     _Type_UNION: UnionArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1701
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,
 *     _Type_LARGE_LIST: LargeListArray,             # <<<<<<<<<<<<<<
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_LIST); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1702
 *     _Type_LIST: ListArray,
 *     _Type_LARGE_LIST: LargeListArray,
 *     _Type_UNION: UnionArray,             # <<<<<<<<<<<<<<
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1703
 *     _Type_LARGE_LIST: LargeListArray,
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_STRING: StringArray,
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BinaryArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1704
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 *     _Type_LARGE_STRING: LargeStringArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1705
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,
 *     _Type_LARGE_BINARY: LargeBinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_STRING: LargeStringArray,
 *     _Type_DICTIONARY: DictionaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_BINARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeBinaryArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1706
 *     _Type_STRING: StringArray,
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 *     _Type_LARGE_STRING: LargeStringArray,             # <<<<<<<<<<<<<<
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_STRING); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1707
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 *     _Type_LARGE_STRING: LargeStringArray,
 *     _Type_DICTIONARY: DictionaryArray,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1708
 *     _Type_LARGE_STRING: LargeStringArray,
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1709
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,             # <<<<<<<<<<<<<<
 *     _Type_STRUCT: StructArray,
 *     _Type_EXTENSION: ExtensionArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Decimal128Array)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1710
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,             # <<<<<<<<<<<<<<
 *     _Type_EXTENSION: ExtensionArray,
 * }
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1711
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,
 *     _Type_EXTENSION: ExtensionArray,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::EXTENSION); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray)) < 0) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__array_classes);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__array_classes, ((PyObject*)__pyx_t_19));
  __Pyx_GIVEREF(__pyx_t_19);
  __pyx_t_19 = 0;

  /* "pyarrow/array.pxi":1729
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_135concat_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/builder.pxi":18
 * # under the License.
 * 
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import tobytes
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(11, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_19) < 0) __PYX_ERR(11, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/builder.pxi":20
 * import six
 * 
 * from pyarrow.compat import tobytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = PyList_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(11, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_tobytes);
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(11, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_19)) __PYX_ERR(11, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_19) < 0) __PYX_ERR(11, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":18
 * # under the License.
 * 
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * cdef class ChunkedArray(_PandasConvertible):
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_18) < 0) __PYX_ERR(12, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":339
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_137chunked_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chunked_array, __pyx_t_18) < 0) __PYX_ERR(12, 339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":669
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/table.pxi":668
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None):
 */
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_pandas, __pyx_t_19) < 0) __PYX_ERR(12, 669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":707
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11RecordBatch_29from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(12, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":706
 *         return cls.from_arrays(arrays, schema=schema)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(12, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":761
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_139_reconstruct_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reconstruct_record_batch, __pyx_t_18) < 0) __PYX_ERR(12, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":768
 * 
 * 
 * def table_to_blocks(options, Table table, categories):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_141table_to_blocks, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_table_to_blocks, __pyx_t_18) < 0) __PYX_ERR(12, 768, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":998
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/table.pxi":997
 *         return Table.from_arrays(newcols, schema=target_schema)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None, bint safe=True):
 */
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_pandas, __pyx_t_19) < 0) __PYX_ERR(12, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1068
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_29from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(12, 1068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1067
 *         return cls.from_arrays(arrays, schema=schema)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(12, 1068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1114
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_31from_pydict, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_pydict, __pyx_t_18) < 0) __PYX_ERR(12, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1113
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_pydict(mapping, schema=None, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_pydict); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_pydict, __pyx_t_19) < 0) __PYX_ERR(12, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1153
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_33from_batches, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_batches, __pyx_t_19) < 0) __PYX_ERR(12, 1153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1152
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(batches, Schema schema=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_batches); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_batches, __pyx_t_18) < 0) __PYX_ERR(12, 1153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1504
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_143_reconstruct_table, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reconstruct_table, __pyx_t_18) < 0) __PYX_ERR(12, 1504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":1511
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_145record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_record_batch, __pyx_t_18) < 0) __PYX_ERR(12, 1511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":1552
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_147table, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_table, __pyx_t_18) < 0) __PYX_ERR(12, 1552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":1605
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_149concat_tables, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat_tables, __pyx_t_18) < 0) __PYX_ERR(12, 1605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_6Tensor_5from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/tensor.pxi":39
 * strides: {0.strides}""".format(self)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(obj, dim_names=None):
 *         cdef:
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/tensor.pxi":150
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseTensorCOO
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO, __pyx_n_s_from_dense_numpy); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/tensor.pxi":149
 * shape: {0.shape}""".format(self)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dense_numpy(cls, obj, dim_names=None):
 *         """
 */
  __pyx_t_18 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO->tp_dict, __pyx_n_s_from_dense_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCOO);

  /* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCOO from numpy.ndarrays
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseTensorCOO_7from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO->tp_dict, __pyx_n_s_from_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCOO);

  /* "pyarrow/tensor.pxi":156
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(data, coords, shape, dim_names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCOO);

  /* "pyarrow/tensor.pxi":182
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCOO
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseTensorCOO_9from_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO->tp_dict, __pyx_n_s_from_tensor, __pyx_t_19) < 0) __PYX_ERR(13, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCOO);

  /* "pyarrow/tensor.pxi":181
 *         return pyarrow_wrap_sparse_tensor_coo(csparse_tensor)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_tensor(obj):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO, __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCOO->tp_dict, __pyx_n_s_from_tensor, __pyx_t_18) < 0) __PYX_ERR(13, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCOO);

  /* "pyarrow/tensor.pxi":267
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseTensorCSR
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR, __pyx_n_s_from_dense_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/tensor.pxi":266
 * shape: {0.shape}""".format(self)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dense_numpy(cls, obj, dim_names=None):
 *         """
 */
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR->tp_dict, __pyx_n_s_from_dense_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCSR);

  /* "pyarrow/tensor.pxi":274
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseTensorCSR from numpy.ndarrays
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseTensorCSR_7from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCSR);

  /* "pyarrow/tensor.pxi":273
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR->tp_dict, __pyx_n_s_from_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCSR);

  /* "pyarrow/tensor.pxi":304
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseTensorCSR
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseTensorCSR_9from_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR->tp_dict, __pyx_n_s_from_tensor, __pyx_t_18) < 0) __PYX_ERR(13, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCSR);

  /* "pyarrow/tensor.pxi":303
 *         return pyarrow_wrap_sparse_tensor_csr(csparse_tensor)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_tensor(obj):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR, __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseTensorCSR->tp_dict, __pyx_n_s_from_tensor, __pyx_t_19) < 0) __PYX_ERR(13, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseTensorCSR);

  /* "pyarrow/io.pxi":23
 * from libc.stdlib cimport malloc, free
 * 
 * import re             # <<<<<<<<<<<<<<
 * import six
 * import sys
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_19) < 0) __PYX_ERR(6, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":24
 * 
 * import re
 * import six             # <<<<<<<<<<<<<<
 * import sys
 * import threading
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_19) < 0) __PYX_ERR(6, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":25
 * import re
 * import six
 * import sys             # <<<<<<<<<<<<<<
 * import threading
 * import time
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_19) < 0) __PYX_ERR(6, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":26
 * import six
 * import sys
 * import threading             # <<<<<<<<<<<<<<
 * import time
 * import warnings
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_19) < 0) __PYX_ERR(6, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":27
 * import sys
 * import threading
 * import time             # <<<<<<<<<<<<<<
 * import warnings
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_19) < 0) __PYX_ERR(6, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":28
 * import threading
 * import time
 * import warnings             # <<<<<<<<<<<<<<
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation
 * 
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_19) < 0) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":29
 * import time
 * import warnings
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.util import _stringify_path
 */
  __pyx_t_19 = PyList_New(4); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_BufferedIOBase);
  __Pyx_GIVEREF(__pyx_n_s_BufferedIOBase);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_BufferedIOBase);
  __Pyx_INCREF(__pyx_n_s_IOBase);
  __Pyx_GIVEREF(__pyx_n_s_IOBase);
  PyList_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_IOBase);
  __Pyx_INCREF(__pyx_n_s_TextIOBase);
  __Pyx_GIVEREF(__pyx_n_s_TextIOBase);
  PyList_SET_ITEM(__pyx_t_19, 2, __pyx_n_s_TextIOBase);
  __Pyx_INCREF(__pyx_n_s_UnsupportedOperation);
  __Pyx_GIVEREF(__pyx_n_s_UnsupportedOperation);
  PyList_SET_ITEM(__pyx_t_19, 3, __pyx_n_s_UnsupportedOperation);
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_io, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferedIOBase, __pyx_t_19) < 0) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOBase, __pyx_t_19) < 0) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_TextIOBase); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TextIOBase, __pyx_t_19) < 0) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnsupportedOperation, __pyx_t_19) < 0) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":31
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation
 * 
 * from pyarrow.util import _stringify_path             # <<<<<<<<<<<<<<
 * from pyarrow.compat import (
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)
 */
  __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_n_s_stringify_path);
  __Pyx_GIVEREF(__pyx_n_s_stringify_path);
  PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_stringify_path);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_pyarrow_util, __pyx_t_18, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stringify_path, __pyx_t_18) < 0) __PYX_ERR(6, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":33
 * from pyarrow.util import _stringify_path
 * from pyarrow.compat import (
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = PyList_New(5); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_builtin_pickle);
  __Pyx_GIVEREF(__pyx_n_s_builtin_pickle);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_builtin_pickle);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_19, 2, __pyx_n_s_tobytes);
  __Pyx_INCREF(__pyx_n_s_encode_file_path);
  __Pyx_GIVEREF(__pyx_n_s_encode_file_path);
  PyList_SET_ITEM(__pyx_t_19, 3, __pyx_n_s_encode_file_path);
  __Pyx_INCREF(__pyx_n_s_file_type);
  __Pyx_GIVEREF(__pyx_n_s_file_type);
  PyList_SET_ITEM(__pyx_t_19, 4, __pyx_n_s_file_type);

  /* "pyarrow/io.pxi":32
 * 
 * from pyarrow.util import _stringify_path
 * from pyarrow.compat import (             # <<<<<<<<<<<<<<
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)
 * 
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtin_pickle, __pyx_t_19) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_19) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_19) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_file_path, __pyx_t_19) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_file_type); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_type, __pyx_t_19) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":37
 * 
 * # 64K
 * DEFAULT_BUFFER_SIZE = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_BUFFER_SIZE, __pyx_int_65536) < 0) __PYX_ERR(6, 37, __pyx_L1_error)

  /* "pyarrow/io.pxi":611
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 * BufferedIOBase.register(NativeFile)             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_register); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":710
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16MemoryMappedFile_1create, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile->tp_dict, __pyx_n_s_create, __pyx_t_18) < 0) __PYX_ERR(6, 710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":709
 *         object path
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def create(path, size):
 *         cdef:
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile, __pyx_n_s_create); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile->tp_dict, __pyx_n_s_create, __pyx_t_19) < 0) __PYX_ERR(6, 710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":772
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_151memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_memory_map, __pyx_t_19) < 0) __PYX_ERR(6, 772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":792
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_153create_memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_memory_map, __pyx_t_19) < 0) __PYX_ERR(6, 792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1095
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_155allocate_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_allocate_buffer, __pyx_t_19) < 0) __PYX_ERR(6, 1095, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1339
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_157py_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_buffer, __pyx_t_19) < 0) __PYX_ERR(6, 1339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1348
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_159foreign_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreign_buffer, __pyx_t_19) < 0) __PYX_ERR(6, 1348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1367
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_161as_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_as_buffer, __pyx_t_19) < 0) __PYX_ERR(6, 1367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_163_detect_compression, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_detect_compression, __pyx_t_19) < 0) __PYX_ERR(6, 1484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_165compress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compress, __pyx_t_19) < 0) __PYX_ERR(6, 1496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1557
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_167decompress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompress, __pyx_t_19) < 0) __PYX_ERR(6, 1557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1615
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_169input_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_input_stream, __pyx_t_19) < 0) __PYX_ERR(6, 1615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1667
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_171output_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_output_stream, __pyx_t_19) < 0) __PYX_ERR(6, 1667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_re); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_compile); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__454, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HDFS_PATH_RE, __pyx_t_19) < 0) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
    __Pyx_XGOTREF(__pyx_t_21);
    __Pyx_XGOTREF(__pyx_t_22);
    __Pyx_XGOTREF(__pyx_t_23);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":25
 * try:
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull             # <<<<<<<<<<<<<<
 * except ImportError:
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
      __pyx_t_19 = PyList_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_INCREF(__pyx_n_s_Queue);
      __Pyx_GIVEREF(__pyx_n_s_Queue);
      PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_Queue);
      __Pyx_INCREF(__pyx_n_s_Empty);
      __Pyx_GIVEREF(__pyx_n_s_Empty);
      PyList_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_Empty);
      __Pyx_INCREF(__pyx_n_s_Full);
      __Pyx_GIVEREF(__pyx_n_s_Full);
      PyList_SET_ITEM(__pyx_t_19, 2, __pyx_n_s_Full);
      __pyx_t_18 = __Pyx_Import(__pyx_n_s_queue, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_Queue); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_19) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_Empty); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_19) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_Full); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_19) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

      /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
    }
    __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
    __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
    __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __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_19); __pyx_t_19 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 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;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/io-hdfs.pxi":26
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * except ImportError:             # <<<<<<<<<<<<<<
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * 
 */
    __pyx_t_3 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("pyarrow.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0) __PYX_ERR(2, 26, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GOTREF(__pyx_t_20);

      /* "pyarrow/io-hdfs.pxi":27
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * except ImportError:
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_17 = PyList_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_INCREF(__pyx_n_s_Queue);
      __Pyx_GIVEREF(__pyx_n_s_Queue);
      PyList_SET_ITEM(__pyx_t_17, 0, __pyx_n_s_Queue);
      __Pyx_INCREF(__pyx_n_s_Empty);
      __Pyx_GIVEREF(__pyx_n_s_Empty);
      PyList_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_Empty);
      __Pyx_INCREF(__pyx_n_s_Full);
      __Pyx_GIVEREF(__pyx_n_s_Full);
      PyList_SET_ITEM(__pyx_t_17, 2, __pyx_n_s_Full);
      __pyx_t_16 = __Pyx_Import(__pyx_n_s_Queue, __pyx_t_17, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Queue); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Empty); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Full); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;
    __pyx_L4_except_error:;

    /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
    __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);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __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_L7_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_173have_libhdfs, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_libhdfs, __pyx_t_20) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_175have_libhdfs3, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_libhdfs3, __pyx_t_20) < 0) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_177strip_hdfs_abspath, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_hdfs_abspath, __pyx_t_20) < 0) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_HadoopFileSystem, __pyx_n_s_connect); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);

  /* "pyarrow/io-hdfs.pxi":108
 *         self.is_open = True
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, *args, **kwargs):
 *         return cls(*args, **kwargs)
 */
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_HadoopFileSystem->tp_dict, __pyx_n_s_connect, __pyx_t_19) < 0) __PYX_ERR(2, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_HadoopFileSystem);

  /* "pyarrow/ipc.pxi":18
 * # under the License.
 * 
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * cdef class Message:
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_19) < 0) __PYX_ERR(7, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/ipc.pxi":138
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13MessageReader_5open_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_19) < 0) __PYX_ERR(7, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":137
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def open_stream(source):
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader, __pyx_n_s_open_stream); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_20) < 0) __PYX_ERR(7, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":418
 *     # TODO(wesm): ARROW-503: Function was renamed. Remove after a period of
 *     # time has passed
 *     get_record_batch = get_batch             # <<<<<<<<<<<<<<
 * 
 *     def read_all(self):
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader, __pyx_n_s_get_batch); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader->tp_dict, __pyx_n_s_get_record_batch, __pyx_t_20) < 0) __PYX_ERR(7, 418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader);

  /* "pyarrow/ipc.pxi":441
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_179get_tensor_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_tensor_size, __pyx_t_20) < 0) __PYX_ERR(7, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":451
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_181get_record_batch_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_record_batch_size, __pyx_t_20) < 0) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":461
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_183write_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_tensor, __pyx_t_20) < 0) __PYX_ERR(7, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":502
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_185read_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_tensor, __pyx_t_20) < 0) __PYX_ERR(7, 502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":529
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_187read_message, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_message, __pyx_t_20) < 0) __PYX_ERR(7, 529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":557
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_189read_schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_schema, __pyx_t_20) < 0) __PYX_ERR(7, 557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":594
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_191read_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_record_batch, __pyx_t_20) < 0) __PYX_ERR(7, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/feather.pxi":22
 * 
 * 
 * class FeatherError(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_19 = __Pyx_CalculateMetaclass(NULL, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_19, __pyx_t_20, __pyx_n_s_FeatherError, __pyx_n_s_FeatherError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_19, __pyx_n_s_FeatherError, __pyx_t_20, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FeatherError, __pyx_t_16) < 0) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":20
 * from cpython.ref cimport PyObject
 * 
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import frombytes, pickle
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_20) < 0) __PYX_ERR(15, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":22
 * import six
 * 
 * from pyarrow.compat import frombytes, pickle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = PyList_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_20, 0, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_pickle);
  __Pyx_GIVEREF(__pyx_n_s_pickle);
  PyList_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_pickle);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_20, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_20) < 0) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_pickle); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_20) < 0) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_193is_named_tuple, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_named_tuple, __pyx_t_19) < 0) __PYX_ERR(15, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":36
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_CalculateMetaclass(NULL, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_19, __pyx_t_20, __pyx_n_s_SerializationCallbackError, __pyx_n_s_SerializationCallbackError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_t_16 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_26SerializationCallbackError_1__init__, 0, __pyx_n_s_SerializationCallbackError___ini, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__478)); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_n_s_init, __pyx_t_16) < 0) __PYX_ERR(15, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pyarrow/serialization.pxi":36
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_19, __pyx_n_s_SerializationCallbackError, __pyx_t_20, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SerializationCallbackError, __pyx_t_16) < 0) __PYX_ERR(15, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":42
 * 
 * 
 * class DeserializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_CalculateMetaclass(NULL, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_20, __pyx_t_19, __pyx_n_s_DeserializationCallbackError, __pyx_n_s_DeserializationCallbackError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_t_16 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_28DeserializationCallbackError_1__init__, 0, __pyx_n_s_DeserializationCallbackError___i, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__480)); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_n_s_init, __pyx_t_16) < 0) __PYX_ERR(15, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pyarrow/serialization.pxi":42
 * 
 * 
 * class DeserializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_20, __pyx_n_s_DeserializationCallbackError, __pyx_t_19, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeserializationCallbackError, __pyx_t_16) < 0) __PYX_ERR(15, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":222
 * 
 * 
 * _default_serialization_context = SerializationContext()             # <<<<<<<<<<<<<<
 * _default_context_initialized = False
 * 
 */
  __pyx_t_19 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext)); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_serialization_context, __pyx_t_19) < 0) __PYX_ERR(15, 222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":223
 * 
 * _default_serialization_context = SerializationContext()
 * _default_context_initialized = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_context_initialized, Py_False) < 0) __PYX_ERR(15, 223, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_195_get_default_context, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_context, __pyx_t_19) < 0) __PYX_ERR(15, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_18SerializedPyObject_7from_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_19) < 0) __PYX_ERR(15, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":293
 *         return output
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_components(components):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject, __pyx_n_s_from_components); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_20) < 0) __PYX_ERR(15, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":336
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_197serialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize, __pyx_t_20) < 0) __PYX_ERR(15, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":370
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_199serialize_to, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_to, __pyx_t_20) < 0) __PYX_ERR(15, 370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":387
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_201read_serialized, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_serialized, __pyx_t_20) < 0) __PYX_ERR(15, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":413
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_203deserialize_from, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_from, __pyx_t_20) < 0) __PYX_ERR(15, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":436
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_205deserialize_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_components, __pyx_t_20) < 0) __PYX_ERR(15, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":454
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_207deserialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize, __pyx_t_20) < 0) __PYX_ERR(15, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_209benchmark_PandasObjectIsNull, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_benchmark_PandasObjectIsNull, __pyx_t_20) < 0) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_211__pyx_unpickle__PandasAPIShim, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__PandasAPIShim, __pyx_t_20) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._have_pandas = __pyx_state[6]; __pyx_result._index = __pyx_state[7]; __pyx_result._loose_version = __pyx_state[8]; __pyx_result._pd = __pyx_state[9]; __pyx_result._series = __pyx_state[10]; __pyx_result._tried_importing_pandas = __pyx_state[11]; __pyx_result._types_api = __pyx_state[12]; __pyx_result._version = __pyx_state[13]; __pyx_result.has_sparse = __pyx_state[14]
 *     if len(__pyx_state) > 15 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_213__pyx_unpickle_Scalar, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Scalar, __pyx_t_20) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_215__pyx_unpickle__PandasConvertible, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__PandasConvertibl, __pyx_t_20) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_217__pyx_unpickle_SerializationContext, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SerializationCont, __pyx_t_20) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/lib.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_20 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Schema_from_pandas_line_963, __pyx_kp_u_Returns_implied_schema_from_dat) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_array_line_99, __pyx_kp_u_Create_pyarrow_Array_instance_f) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Array_cast_line_517, __pyx_kp_u_Cast_array_values_to_another_da) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Array_take_line_817, __pyx_kp_u_Take_elements_from_an_array_The) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Array_filter_line_860, __pyx_kp_u_Filter_the_array_with_a_boolean) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Table_from_pandas_line_998, __pyx_kp_u_Convert_pandas_DataFrame_to_an) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_20) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pyarrow.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pyarrow.lib");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* GetAttr3 */
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;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* 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_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* py_abs */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
    if (likely(Py_SIZE(n) == -1)) {
        return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    {
        PyObject *copy = _PyLong_Copy((PyLongObject*)n);
        if (likely(copy)) {
            Py_SIZE(copy) = -(Py_SIZE(copy));
        }
        return copy;
    }
#else
    return PyNumber_Negative(n);
#endif
}
#endif

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    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_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_RemainderObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
            }
        }
                __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
            if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
                return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
            else {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
            }
        }
                __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
                {
                    long q, r;
                    q = a / b;
                    r = a - q*b;
                    q -= ((r != 0) & ((r ^ b) < 0));
                    x = q;
                }
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                {
                    PY_LONG_LONG q, r;
                    q = lla / llb;
                    r = lla - q*llb;
                    q -= ((r != 0) & ((r ^ llb) < 0));
                    llx = q;
                }
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        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);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *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)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* decode_c_bytes */
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;
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* StringJoin */
#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* CallNextTpTraverse */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->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);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#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;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < 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);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != 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);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (__Pyx_CyFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

/* GetNameInClass */
static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(enum  arrow::Type::type value) {
    const enum  arrow::Type::type neg_one = (enum  arrow::Type::type) ((enum  arrow::Type::type) 0 - (enum  arrow::Type::type) 1), const_zero = (enum  arrow::Type::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::Type::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::Type::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::Type::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type(enum  arrow::UnionMode::type value) {
    const enum  arrow::UnionMode::type neg_one = (enum  arrow::UnionMode::type) ((enum  arrow::UnionMode::type) 0 - (enum  arrow::UnionMode::type) 1), const_zero = (enum  arrow::UnionMode::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::UnionMode::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::UnionMode::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::UnionMode::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
    const uint8_t neg_one = (uint8_t) ((uint8_t) 0 - (uint8_t) 1), const_zero = (uint8_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(enum  arrow::TimeUnit::type value) {
    const enum  arrow::TimeUnit::type neg_one = (enum  arrow::TimeUnit::type) ((enum  arrow::TimeUnit::type) 0 - (enum  arrow::TimeUnit::type) 1), const_zero = (enum  arrow::TimeUnit::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::TimeUnit::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::TimeUnit::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) {
    const int8_t neg_one = (int8_t) ((int8_t) 0 - (int8_t) 1), const_zero = (int8_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int8_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
    const int16_t neg_one = (int16_t) ((int16_t) 0 - (int16_t) 1), const_zero = (int16_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int16_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int16_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int16_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
    const uint16_t neg_one = (uint16_t) ((uint16_t) 0 - (uint16_t) 1), const_zero = (uint16_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint16_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint16_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
    const int32_t neg_one = (int32_t) ((int32_t) 0 - (int32_t) 1), const_zero = (int32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
    const uint32_t neg_one = (uint32_t) ((uint32_t) 0 - (uint32_t) 1), const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
    const uint64_t neg_one = (uint64_t) ((uint64_t) 0 - (uint64_t) 1), const_zero = (uint64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
static CYTHON_INLINE enum  arrow::Type::type __Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(PyObject *x) {
    const enum  arrow::Type::type neg_one = (enum  arrow::Type::type) ((enum  arrow::Type::type) 0 - (enum  arrow::Type::type) 1), const_zero = (enum  arrow::Type::type) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum  arrow::Type::type) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum  arrow::Type::type) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum  arrow::Type::type) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum  arrow::Type::type) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) >= 2 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((((enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum  arrow::Type::type) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) >= 3 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((((((enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum  arrow::Type::type) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, 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(enum  arrow::Type::type) >= 4 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((((((((enum  arrow::Type::type)digits[3]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum  arrow::Type::type) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum  arrow::Type::type) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum  arrow::Type::type) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 2 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((enum  arrow::Type::type)-1)*(((((enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum  arrow::Type::type) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 2 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) ((((((enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum  arrow::Type::type) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 3 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((enum  arrow::Type::type)-1)*(((((((enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum  arrow::Type::type) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 3 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) ((((((((enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum  arrow::Type::type) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, 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(enum  arrow::Type::type) - 1 > 4 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((enum  arrow::Type::type)-1)*(((((((((enum  arrow::Type::type)digits[3]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum  arrow::Type::type) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, 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(enum  arrow::Type::type) - 1 > 4 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) ((((((((((enum  arrow::Type::type)digits[3]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum  arrow::Type::type) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum  arrow::Type::type) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum  arrow::Type::type val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum  arrow::Type::type) -1;
        }
    } else {
        enum  arrow::Type::type val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum  arrow::Type::type) -1;
        val = __Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum  arrow::Type::type");
    return (enum  arrow::Type::type) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum  arrow::Type::type");
    return (enum  arrow::Type::type) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int64_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int64_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int64_t) -1;
        }
    } else {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyInt_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
    const uint8_t neg_one = (uint8_t) ((uint8_t) 0 - (uint8_t) 1), const_zero = (uint8_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint8_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint8_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint8_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) {
                            return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) {
                            return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) {
                            return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint8_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(uint8_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint8_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint8_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(uint8_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint8_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint8_t) -1;
        }
    } else {
        uint8_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint8_t) -1;
        val = __Pyx_PyInt_As_uint8_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint8_t");
    return (uint8_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint8_t");
    return (uint8_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
    const int32_t neg_one = (int32_t) ((int32_t) 0 - (int32_t) 1), const_zero = (int32_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int32_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int32_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 2 * PyLong_SHIFT) {
                            return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 3 * PyLong_SHIFT) {
                            return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 4 * PyLong_SHIFT) {
                            return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int32_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int32_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int32_t) -1;
        }
    } else {
        int32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int32_t) -1;
        val = __Pyx_PyInt_As_int32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int32_t");
    return (int32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int32_t");
    return (int32_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) {
    const int16_t neg_one = (int16_t) ((int16_t) 0 - (int16_t) 1), const_zero = (int16_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int16_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int16_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int16_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int16_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) >= 2 * PyLong_SHIFT) {
                            return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) >= 3 * PyLong_SHIFT) {
                            return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_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(int16_t) >= 4 * PyLong_SHIFT) {
                            return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int16_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int16_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int16_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int16_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int16_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_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(int16_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_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(int16_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int16_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int16_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int16_t) -1;
        }
    } else {
        int16_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int16_t) -1;
        val = __Pyx_PyInt_As_int16_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int16_t");
    return (int16_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int16_t");
    return (int16_t) -1;
}

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
